Comments (10)
Hello,
I'm having a similar problem with AJAX calls.
Once the theme is installed V 3.1.1 via the ZIP archive in release, everything works fine, Ajax calls (search, add to cart) work as expected.
But once the assets folder has been recompiled via webpack, the Ajax calls no longer display the modal windows (product search or add-to-cart confirmation modal).
My Node parameters, hosting, etc. are the same.
from falcon.
looks like your files are missing module code.
Can you tell me how did you build your assets and what package manager and version are you using? (yarn/npm/pnpm)
Yes that url will return you that error it should contain exit
if there is no ajax used. Actually we are using this controller only for that ajax request.
from falcon.
Hello @Oksydan
I used npm to build my assets, my version is : 9.7.1
Webpack 5.76.3
I used only the command npm run watch to build.
Here's the log :
`PS D:\Romaric\Clients\EMC_Suspensions\site_ps17\perso_EMC\themes\emcshocks_dev> npm run watch
[email protected] watch
webpack watch --progress --mode=development
95% emitting emit(node:11356) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_.
(Use node --trace-deprecation ...
to show where the warning was created)
assets by status 590 KiB [cached] 16 assets
assets by status 683 KiB [compared for emit]
assets by path js/.js 654 KiB
assets by chunk 257 KiB (id hint: vendors) 10 assets
+ 21 assets
assets by path css/.css 29.9 KiB
asset css/listing.css 4.98 KiB [compared for emit] (name: listing)
asset css/css_dynamic_modal__index_scss.css 4.48 KiB [compared for emit]
asset css/css_dynamic_dropdown__index_scss.css 4.33 KiB [compared for emit]
+ 10 assets
assets by status 490 KiB [emitted]
asset css/theme.css 297 KiB [emitted] (name: theme)
asset js/theme.js 192 KiB [emitted] (name: theme) 1 related asset
asset preload.html 711 bytes [emitted]
Entrypoint theme 685 KiB (965 KiB) = js/swipervendor.js 196 KiB css/theme.css 297 KiB js/theme.js 192 KiB 18 auxiliary assets
Entrypoint product 11.6 KiB (8.27 KiB) = css/product.css 2.4 KiB js/product.js 9.23 KiB 1 auxiliary asset
Entrypoint checkout 11.7 KiB (6.11 KiB) = css/checkout.css 3.52 KiB js/checkout.js 8.16 KiB 1 auxiliary asset
Entrypoint listing 133 KiB (139 KiB) = css/listing.css 4.98 KiB js/listing.js 128 KiB 1 auxiliary asset
runtime modules 25.8 KiB 81 modules
orphan modules 415 KiB [orphan] 53 modules
cacheable modules 676 KiB (javascript) 327 KiB (css/mini-extract)
modules by path ./node_modules/ 610 KiB (javascript) 2.71 KiB (css/mini-extract)
modules by path ./node_modules/swiper/ 238 KiB (javascript) 2.71 KiB (css/mini-extract) 86 modules
modules by path ./node_modules/bootstrap/js/ 110 KiB 13 modules
+ 10 modules
modules by path ./js/ 65.4 KiB 36 modules
modules by path ./css/ 450 bytes (javascript) 324 KiB (css/mini-extract)
modules by path ./css/dynamic/ 250 bytes (javascript) 16.3 KiB (css/mini-extract) 10 modules
modules by path ./css/.scss 200 bytes (javascript) 308 KiB (css/mini-extract)
javascript modules 200 bytes 4 modules
css modules 308 KiB 4 modules
external "jQuery" 42 bytes [built] [code generated]
external "prestashop" 42 bytes [built] [code generated]
webpack 5.76.3 compiled successfully in 12463 ms
assets by status 1.43 MiB [cached] 61 assets
assets by status 298 KiB [emitted]
asset css/theme.css 297 KiB [emitted] (name: theme)
asset preload.html 711 bytes [emitted]
Entrypoint theme 685 KiB (965 KiB) = js/swipervendor.js 196 KiB css/theme.css 297 KiB js/theme.js 192 KiB 18 auxiliary assets
Entrypoint product 11.6 KiB (8.27 KiB) = css/product.css 2.4 KiB js/product.js 9.23 KiB 1 auxiliary asset
Entrypoint checkout 11.7 KiB (6.11 KiB) = css/checkout.css 3.52 KiB js/checkout.js 8.16 KiB 1 auxiliary asset
Entrypoint listing 133 KiB (139 KiB) = css/listing.css 4.98 KiB js/listing.js 128 KiB 1 auxiliary asset
cached modules 737 KiB (javascript) 29.9 KiB (css/mini-extract) 13.9 KiB (runtime) [cached] 231 modules
orphan modules 318 KiB [orphan] 1 module
cacheable modules 50 bytes (javascript) 297 KiB (css/mini-extract)
./css/theme.scss 50 bytes [built]
css ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[0].use[3]!./css/theme.scss 297 KiB [built] [code generated]
webpack 5.76.3 compiled successfully in 6387 ms
`
from falcon.
I also use npm v8.1.0 and webpack v5.53.0.
To perform the build, I use Windows 10 21H2, and the server is running on Linux, which I didn't mention before.
To build, I mix between npm run build and npm run watch, and the result is always the same: the ajax and ajaxsearch calls don't work.
I haven't modified anything in the package.json, so it's the same default configuration.
Here, I'll show you the log:
95% emitting emit(node:11648) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.
(Use `node --trace-deprecation ...` to show where the warning was created)
assets by status 590 KiB [cached] 16 assets
assets by status 1.15 MiB [emitted]
assets by path js/*.js 845 KiB
assets by chunk 257 KiB (id hint: vendors)
asset js/vendors-node_modules_bootstrap_js_src_util_js-node_modules_popper_js_dist_esm_popper_js.js 93.1 KiB [emitted] (id hint: vendors) 1 related asset
asset js/vendors-node_modules_bootstrap_js_src_modal_js.js 27.4 KiB [emitted] (id hint: vendors) 1 related asset
+ 8 assets
+ 22 assets
assets by path css/*.css 328 KiB
asset css/theme.css 298 KiB [emitted] (name: theme)
asset css/listing.css 4.98 KiB [emitted] (name: listing)
asset css/css_dynamic_modal__index_scss.css 4.48 KiB [emitted]
asset css/css_dynamic_dropdown__index_scss.css 4.33 KiB [emitted]
+ 10 assets
asset preload.html 699 bytes [compared for emit]
Entrypoint theme 686 KiB (965 KiB) = js/swipervendor.js 196 KiB css/theme.css 298 KiB js/theme.js 192 KiB 18 auxiliary assets
Entrypoint product 11.6 KiB (8.27 KiB) = css/product.css 2.4 KiB js/product.js 9.23 KiB 1 auxiliary asset
Entrypoint checkout 11.7 KiB (6.11 KiB) = css/checkout.css 3.52 KiB js/checkout.js 8.16 KiB 1 auxiliary asset
Entrypoint listing 133 KiB (139 KiB) = css/listing.css 4.98 KiB js/listing.js 128 KiB 1 auxiliary asset
runtime modules 25.7 KiB 81 modules
orphan modules 415 KiB [orphan] 53 modules
cacheable modules 676 KiB (javascript) 328 KiB (css/mini-extract)
modules by path ./node_modules/ 610 KiB (javascript) 2.71 KiB (css/mini-extract)
modules by path ./node_modules/swiper/ 238 KiB (javascript) 2.71 KiB (css/mini-extract) 86 modules
modules by path ./node_modules/bootstrap/js/ 110 KiB 13 modules
+ 10 modules
modules by path ./js/ 65.4 KiB 36 modules
modules by path ./css/ 450 bytes (javascript) 325 KiB (css/mini-extract)
modules by path ./css/dynamic/ 250 bytes (javascript) 16.3 KiB (css/mini-extract) 10 modules
modules by path ./css/*.scss 200 bytes (javascript) 309 KiB (css/mini-extract)
javascript modules 200 bytes 4 modules
css modules 309 KiB 4 modules
external "jQuery" 42 bytes [built] [code generated]
external "prestashop" 42 bytes [built] [code generated]
webpack 5.76.3 compiled successfully in 11472 ms
assets by status 1.72 MiB [cached] 62 assets
asset preload.html 699 bytes [emitted]
Entrypoint theme 686 KiB (965 KiB) = js/swipervendor.js 196 KiB css/theme.css 298 KiB js/theme.js 192 KiB 18 auxiliary assets
Entrypoint product 11.6 KiB (8.27 KiB) = css/product.css 2.4 KiB js/product.js 9.23 KiB 1 auxiliary asset
Entrypoint checkout 11.7 KiB (6.11 KiB) = css/checkout.css 3.52 KiB js/checkout.js 8.16 KiB 1 auxiliary asset
Entrypoint listing 133 KiB (139 KiB) = css/listing.css 4.98 KiB js/listing.js 128 KiB 1 auxiliary asset
cached modules 737 KiB (javascript) 328 KiB (css/mini-extract) 13.9 KiB (runtime) [cached] 232 modules
orphan modules 319 KiB [orphan] 1 module
./css/theme.scss 50 bytes [built]
webpack 5.76.3 compiled successfully in 4776 ms
from falcon.
Hi,
I tried to reproduce an issue with node version 18.12.1
and npm version 18.12.1
but everything is working as expected π.
It just looks like you are missing that modules assets. It should compile those files and include them in theme.js files.
modules by path ../../../modules/ 15.9 KiB (javascript) 580 bytes (css/mini-extract)
modules by path ../../../modules/is_favoriteproducts/_theme_dev/src/ 7.72 KiB (javascript) 580 bytes (css/mini-extract) 6 modules
modules by path ../../../modules/is_searchbar/_theme_dev/src/js/theme/ 3.92 KiB 2 modules
../../../modules/is_shoppingcart/_theme_dev/src/js/theme/index.js 2.81 KiB [built] [code generated]
../../../modules/is_themecore/_theme_dev/src/js/listing/index.js 1.42 KiB [built] [code generated]
Could you check if for example rootProject/modules/is_searchbar/_theme_dev/src/js/theme/index.js
file exists in your project?
BTW I recommend using dev script instead of watch script for development. Watch script won't load your changes live with HMR.
I am not sure if your problem is windows specific problem π€. Are you using windows WSL?
You can also add check what extraEntries your webpack config is trying to add. Go to themes/falcon/_dev/webpack/webpack.vars.js
, find:
const extraEntries = [];
for (const workspace of workspaces) {
extraEntries.push(...glob.sync(`${workspace}/src/js/${entry}/index.js`));
extraEntries.push(...glob.sync(`${workspace}/src/css/${entry}/index.scss`));
}
and add after that for of
:
console.log(extraEntries);
process.exit(0);
Then run npm run build
and check output in your terminal.
It should contains a least:
'../../../modules/is_searchbar/_theme_dev/src/js/theme/index.js',
'../../../modules/is_shoppingcart/_theme_dev/src/js/theme/index.js',
If you are using is_favoriteproducts
module is should log:
'../../../modules/is_favoriteproducts/_theme_dev/src/js/theme/index.js',
'../../../modules/is_searchbar/_theme_dev/src/js/theme/index.js',
'../../../modules/is_shoppingcart/_theme_dev/src/js/theme/index.js',
'../../../modules/is_favoriteproducts/_theme_dev/src/css/theme/index.scss'
from falcon.
Apologies for the delay, I was running some tests because I didn't know about adding modules to the project folder. Thank you so much for your patience with all my questions.
Unfortunately, when I followed your instructions to add:
console.log(extraEntries);
process.exit(0);
It only displays an empty array.
I also installed the same version of Node and updated npm.
Should I update something else?
I'm not using Windows WSL, but after this comment, I'll install it to see if it works. If not, I'll also try using a Live USB with Linux to see if it works.
What else could be causing my array to be empty?
from falcon.
Solved!
I have solved the problem. The issue was in the package.json file under the WorkSpaces section.
During these days without a response, I have been investigating (although I also attended to other unrelated matters, hence the delay).
But basically, my modules are not located at "../../../modules/*/_theme_dev/"
Instead, they are located at: "../modules/*/_theme_dev/" in relation to the package.json file.
Here is my folder structure:
βββ assets
β βββ css
β βββ fonts
β βββ img
β βββ img-dist
β βββ js
β βββ preload.html
βββ cache
βββ config
β βββ assets.yml
β βββ theme.yml
βββ _dev
β βββ css
β βββ img
β βββ js
β βββ node_modules
β βββ package.json <--------
β βββ package-lock.json
β βββ webpack
β βββ webpack.config.js
β βββ yarn.lock
βββ falcon.zip
βββ LICENSE.md
βββ Makefile
\βββ modules
β βββ blockreassurance
β βββ contactform
β βββ is_imageslider
β βββ is_searchbar
β βββ is_shoppingcart
β βββ is_themecore
β βββ productcomments
β βββ ps_advertising
β βββ ps_banner
β βββ ps_bestsellers
β βββ ps_brandlist
β βββ ps_categoryproducts
β βββ ps_categorytree
β βββ ps_contactinfo
β βββ ps_crossselling
β βββ ps_currencyselector
β βββ ps_customeraccountlinks
β βββ ps_customersignin
β βββ ps_emailalerts
β βββ ps_emailsubscription
β βββ ps_facetedsearch
β βββ ps_featuredproducts
β βββ psgdpr
β βββ ps_imageslider
β βββ ps_languageselector
β βββ ps_legalcompliance
β βββ ps_linklist
β βββ ps_mainmenu
β βββ ps_newproducts
β βββ ps_productinfo
β βββ ps_rssfeed
β βββ ps_sharebuttons
β βββ ps_socialfollow
β βββ ps_specials
β βββ ps_supplierlist
β βββ ps_viewedproduct
βββ package-lock.json
βββ preview.png
βββ README.md
βββ templates
βββ catalog
βββ checkout
βββ cms
βββ components
βββ contact.tpl
βββ customer
βββ errors
βββ index.tpl
βββ layouts
βββ page.tpl
βββ _partials
It's most likely that I made a mistake at some point. I apologize for that. However, if anyone else encounters the same issue, I recommend verifying if the modules are being added to the correct folder.
Thank you for your patience and sorry for the inconvenience!
from falcon.
Thanks for thΓ© solution !
I'm on vacations these 2 following weeks, so I'll try this solution when I get back to work.
from falcon.
that's not proper solution.
You modules should stay inside root/modules folder. Not inside theme folder.
../../../modules
should take you up to root modules folder and there your js/css source files should exists.
Unfortunately I wasn't able to reproduce an issue. In fact I have no idea how to reproduce it. If you are inside themes/theme_name/_dev
that ../../../
should take you up to root folder.
from falcon.
I know it's not an appropriate solution, but now that you mention it, it's most likely that those who experience this issue don't have PrestaShop installed locally, only the theme like in my case.
Honestly, I was a bit lazy to do a local installation, I just wanted to work with the theme. However, I also don't want to work improperly, so I will install PrestaShop locally. That will most likely solve the original problem.
Once again, thank you very much for your patience, @Oksydan.
from falcon.
Related Issues (20)
- π [BUG] - [FIX] promo code click doesn't work, wrong class to the link HOT 2
- π [BUG] - [FIX] in the checkout page the promo code is not added by click to the cart summary in ajax mode HOT 1
- Some resource not correctly linked after first installation HOT 6
- π [BUG] - unknown tag 'appendParamToUrl' when customer is set to a new group and only this one HOT 3
- π [BUG] - is_shoppingcart in displayNav2 hooks not work HOT 3
- π [BUG] - [Fix] writing error in customer/order-detail.tpl HOT 2
- π [REQUEST] - have the possibility of easily choosing a font-family different from the default one HOT 1
- π [REQUEST] - Replace twitter icon with the new X icon HOT 1
- π [REQUEST] - add an option to is_searchbar to add a category selection HOT 4
- π [REQUEST] - Reduce the preview.png size HOT 2
- π [BUG] - BIG problem with child theme - only the theme.css and theme.js files are loaded, the other three types of files are not loaded listing, product and checkout HOT 1
- π [BUG] - The preload tag is missing when the css compression is active HOT 3
- π [BUG] - [FIX] Graphical issue with ps_checkout module in payment list HOT 1
- π [BUG] - is_themecore doesn't create webp images HOT 7
- π [BUG] - [FIX] is_imageslider wrong use of the legend field, it should be used for the alt_text HOT 2
- π [BUG] - [FIX] into ps_languageselector.tpl and ps_currencyselector.tpl it is necessary to change aria-labelledby to aria-label to avoid an accessibility error HOT 2
- π [REQUEST] - is_searchbar add a field to its configuration page to choose the number of items to show in the window HOT 2
- [IMPROVEMENT] - sort-orders.tpl and per-page.tpl it is necessary to add aria-label to their select tag HOT 1
- π [BUG] - is_searchbar javascript error - TypeError: Cannot read properties of undefined (reading 'update') HOT 7
- π [BUG] - Some fix to do for the Product microdata HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from falcon.