Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.4.4 | 1.5.0 introduce new Module parse failed #126

Open
MkLHX opened this issue Feb 19, 2023 · 4 comments
Open

1.4.4 | 1.5.0 introduce new Module parse failed #126

MkLHX opened this issue Feb 19, 2023 · 4 comments

Comments

@MkLHX
Copy link

MkLHX commented Feb 19, 2023

node v16.15
[email protected]
[email protected]

To find a solution to #121 I try to update [email protected] and use [email protected]

The result is a new error about Module parse.


 ERROR  Failed to compile with 1 error                                                                                                                                16:09:27

 error  in ./node_modules/vue-notion/dist/esm.js

Module parse failed: Unexpected token (16:31)
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
|   let index = -1;
|   Object.keys(blockMap).forEach(id => {
>     blockMap[id].value.content?.forEach(blockId => {
|       const blockType = blockMap[blockId]?.value?.type;
|       if (blockType && blockType !== lastType) {

 @ ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/components/WaterPump/PumpCalibration/PumpCalibrationDialog/TutorialItem.vue?vue&type=script&lang=js& 1:0-59 5:4-18 23:26-39   
 @ ./src/components/WaterPump/PumpCalibration/PumpCalibrationDialog/TutorialItem.vue?vue&type=script&lang=js&
 @ ./src/components/WaterPump/PumpCalibration/PumpCalibrationDialog/TutorialItem.vue
 @ ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/components/WaterPump/PumpCalibration/PumpCalibrationDialog/PumpCalibrationDialog.vue?vue&type=script&lang=js&
 @ ./src/components/WaterPump/PumpCalibration/PumpCalibrationDialog/PumpCalibrationDialog.vue?vue&type=script&lang=js&
 @ ./src/components/WaterPump/PumpCalibration/PumpCalibrationDialog/PumpCalibrationDialog.vue
 @ ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/components/WaterPump/WaterPumpBlock/WaterPumpBloc.vue?vue&type=script&lang=js&
 @ ./src/components/WaterPump/WaterPumpBlock/WaterPumpBloc.vue?vue&type=script&lang=js&
 @ ./src/components/WaterPump/WaterPumpBlock/WaterPumpBloc.vue
 @ ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/views/WaterPumpsView.vue?vue&type=script&lang=js&
 @ ./src/views/WaterPumpsView.vue?vue&type=script&lang=js&
 @ ./src/views/WaterPumpsView.vue
 @ ./src/router/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.0.68:8081&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

Each object key looking like blockMap[id].value.content?.forEach cannot be parsed because the ? on the key content.

When I remove all the ? and fix syntax the module can be parsed and built.

So I don't know what happened with the syntax but vuejs2.7.14 is still not compatible.

@MkLHX MkLHX changed the title 1.4.4 introduce new Module parse failed 1.4.4 | 1.5.0 introduce new Module parse failed Feb 19, 2023
@janniks
Copy link
Owner

janniks commented Feb 19, 2023

Thanks for all the logs -- could you try updating to 1.5.1 ? 📦

@MkLHX
Copy link
Author

MkLHX commented Feb 19, 2023

Thanks for providing releases so quickly!

build was executed but with a warning :

warning  in ./node_modules/vue-notion/dist/esm.js
Module not found: Error: Can't resolve 'encoding' in '<my_project_path>\node_modules\vue-notion\dist'

and of course Notion page wasn't rendered now.

@janniks
Copy link
Owner

janniks commented Feb 19, 2023

Hmm, not sure about this one -- Maybe try installing the encoding npm package (i see it's a peerDep from node-fetch via cross-fetch in the package lockfile).
Might also help to remove node_modules and (e.g. nuxt) cache and npm install again.

@MkLHX
Copy link
Author

MkLHX commented Feb 19, 2023

The issue seems to be from my project because on this project with 1.4.3 or 1.5.1 the Notion page is rendered correctly.

https://github.com/MkLHX/vue_notion_test_project

I'm going to push research about what provides the issue on my side.

Maybe an idea:
the historical project was built with [email protected] and the test project with [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants