ManukMinasyan / vue-functional-calendar

Vue.js Functional Calendar | Component/Package
https://vue-functional-calendar.now.sh/
MIT License
467 stars 84 forks source link

SyntaxError: Cannot use import statement outside a module #157

Closed BB-000 closed 8 months ago

BB-000 commented 11 months ago

I've installed and tried to implement as directed, but cannot get it to work and get this error. Anyone else run into this / know how to fix it..?

I believe it's to do with index.js using require(), but don't know how to remedy this...

"Runtime error in CODE of 'pages/node': Runtime error in HEAD of 'parts/node' when called from 'pages/node': Runtime error in CODE of 'parts/node': Node microservice request failed with error: /node_modules/vue-functional-calendar/index.js:2
import FunctionalCalendar from './src/components/FunctionalCalendar.vue'
^^^^^^

SyntaxError: Cannot use import statement outside a module
ManukMinasyan commented 8 months ago

The error you're encountering indicates an issue with using an import statement outside of a module. This usually happens when using the import syntax in a file that is not recognized as a module by Node.js.

Node.js Version: Make sure that your Node.js version supports ECMAScript modules (ESM). If you are using a version of Node.js that is older than version 13, you might need to enable ESM in your project.

To enable ESM, you can add "type": "module" to your package.json file:

{
  "type": "module",
  // other configurations...
}