janniks / vue-notion

A fast Vue renderer for Notion pages
https://vue-notion.now.sh
Other
883 stars 65 forks source link

Module parse failed #121

Closed cyberz closed 1 year ago

cyberz commented 1 year ago

Module parse failed: Unexpected token (1:22615) 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 > ...

WARN  Compiled with 19 warnings

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'Fragment' (imported as 'X') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'createBlock' (imported as 'm') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'createCommentVNode' (imported as 'O') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'createElementBlock' (imported as 'c') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'createElementVNode' (imported as '_') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'createTextVNode' (imported as 'ce') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'createVNode' (imported as 'y') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'guardReactiveProps' (imported as 'Q') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'mergeProps' (imported as 'l') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'normalizeClass' (imported as 'A') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'normalizeProps' (imported as 'k') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'normalizeStyle' (imported as 'j') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'openBlock' (imported as 'r') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'renderList' (imported as 're') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'renderSlot' (imported as 'N') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'resolveComponent' (imported as 'f') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'resolveDynamicComponent' (imported as 'I') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'toDisplayString' (imported as 'U') was not found in 'vue'

 WARN  in .../repo/node_modules/vue-notion/dist/vue-notion.js

"export 'withCtx' (imported as 'R') was not found in 'vue'
Krishna-najpk commented 1 year ago

Same issue. Can anybody answer?

janniks commented 1 year ago

This is strange. Nothing has changed in a while. Which version of vue-notion are you using?

Krishna-najpk commented 1 year ago

I installed using npm install vue-notion command for vuejs project and it added 3.0.0-alpha.1 version for me

janniks commented 1 year ago

Apologies, the latest tag was pointing to an alpha version (which only works with vue 3). This is resolved now. You can install again using npm install vue-notion@latest or npm install vue-notion@^1.4.3

Krishna-najpk commented 1 year ago

I installed using npm install vue-notion@^1.4.3 but I am still getting this error...

ERROR Failed to compile with 1 errors friendly-errors 19:10:22

ERROR in ./node_modules/vue-notion/dist/esm.js friendly-errors 19:10:22

Module parse failed: Unexpected token (1793:175) friendly-errors 19:10:22 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 | | // return empty notion decorated text if row is empty

  return (this === null || this === void 0 ? void 0 : (_this$properties = this.properties) === null || _this$properties === void 0 ? void 0 : _this$properties[columnId]) ?? [[" ", false]];
},
MkLHX commented 1 year ago

Same issue here. nodejs 16 vuejs 2.6.14 vue-notion 1.4.3

ERROR  Failed to compile with 1 error2:07:32 PM
error  in ./node_modules/vue-notion/dist/esm.js
Module parse failed: Unexpected token (1793:175)
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

// return empty notion decorated text if row is empty
return (this === null || this === void 0 ? void 0 : (_this$properties = this.properties) === null || _this$properties === void 0 ? void 0 : _this$properties[columnId]) ?? [[" ", false]];},

the error is provided by esm.js from dist folder line 1788 to 1800.

the method is:

cell(columnId) {
      var _this$properties;

      // return empty notion decorated text if row is empty
      return (this === null || this === void 0 ? void 0 : (_this$properties = this.properties) === null || _this$properties === void 0 ? void 0 : _this$properties[columnId]) ?? [[" ", false]];
},

When I the return statement is commented no error was encountered.

Did you manage to fix it?

MkLHX commented 1 year ago

Hello there!

I think there is a link to this issue: https://github.com/vuejs/vue-cli/issues/7209

The error is on file dist/esm.js line 1793 column 175 and it's a ?? (Nullish coalescing operator) causing the error. Look at my previous comment at the end of the return line you could find ?? operator. When I remove ?? to put simple ternary operator the build can be processed.

I continue to search about this behavior and try to find a solution.

janniks commented 1 year ago

Thanks for the debugging 🙏 I removed the ?? operator manually and will push a new version.

MkLHX commented 1 year ago

@janniks tank you

janniks commented 1 year ago

I pushed the change and some updates to version 1.5.0 -- please try if that solves all the issues you are seeing 🙏

MkLHX commented 1 year ago

@janniks I had just tried it and got a new error see https://github.com/janniks/vue-notion/issues/126