Hello !
I am getting this error when trying to run "npm run build" on my Nuxt app.
"nuxt": "^2.15.8"
If anyone knows how to fix it please.
Thank you , good afternoon!
ERROR in ./node_modules/@prismicio/client/dist/client.js 102:90
Module parse failed: Unexpected token (102:90)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| const actualParams = { ...params };
| if (!(params && params.page) && !(params == null ? void 0 : params.pageSize)) {
> actualParams.pageSize = ((_a = this.defaultParams) == null ? void 0 : _a.pageSize) ?? 1;
| }
| const url = await this.buildQueryURL(actualParams);
ERROR in ./node_modules/@prismicio/client/dist/buildQueryURL.js 18:36
Module parse failed: Unexpected token (18:36)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| }
| for (const k in params) {
> const name = RENAMED_PARAMS[k] ?? k;
| let value = params[k];
| if (name === "orderings") {
Which version of node are you using? Some packages need a specific version of Node.js and/or may not work correctly with the latest version.
Also, the error mentions that it's missing loaders to handle the client kit. I found this stack-overflow thread where it suggests that updating your babel lib.
WARN Compiled with 1 warnings friendly-errors 13:50:32
WARN in ./.nuxt/prismic/plugins/prismic.js friendly-errors 13:50:32
"export 'default' (imported as 'Prismic') was not found in '@prismicio/client' friendly-errors 13:50:32
friendly-errors 13:50:32
ERROR Failed to compile with 2 errors friendly-errors 13:50:32
ERROR in ./node_modules/@prismicio/client/dist/client.js friendly-errors 13:50:32
Module parse failed: Unexpected token (105:90) friendly-errors 13:50:32
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| const actualParams = { ...params };
| if (!(params && params.page) && !(params == null ? void 0 : params.pageSize)) {
> actualParams.pageSize = ((_a = this.defaultParams) == null ? void 0 : _a.pageSize) ?? 1;
| }
| const url = await this.buildQueryURL(actualParams);
friendly-errors 13:50:32
@ ./node_modules/@prismicio/client/dist/index.js 8:0-51 19:0-37:2 19:0-37:2
@ ./.nuxt/prismic/plugins/prismic.js
@ ./.nuxt/index.js
@ ./.nuxt/client.js
@ multi ./node_modules/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js
friendly-errors 13:50:32
ERROR in ./node_modules/@prismicio/client/dist/buildQueryURL.js friendly-errors 13:50:32
Module parse failed: Unexpected token (18:36) friendly-errors 13:50:32
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| }
| for (const k in params) {
> const name = RENAMED_PARAMS[k] ?? k;
| let value = params[k];
| if (name === "orderings") {
friendly-errors 13:50:32
@ ./node_modules/@prismicio/client/dist/index.js 7:0-51 19:0-37:2
@ ./.nuxt/prismic/plugins/prismic.js
@ ./.nuxt/index.js
@ ./.nuxt/client.js
@ multi ./node_modules/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js
friendly-errors 13:50:32
ℹ Waiting for file changes 13:50:32
ℹ Memory usage: 403 MB (RSS: 575 MB) 13:50:32
ℹ Listening on: http://192.168.1.196:3000/