FurqanSoftware / codemirror-languageserver

Language Server integration for CodeMirror 6
BSD 3-Clause "New" or "Revised" License
183 stars 24 forks source link

got "SyntaxError: Cannot use import statement outside a module" when running #7

Closed mbui0327 closed 2 years ago

mbui0327 commented 2 years ago

I followed the sample code and run into this error. Anyone knows why? thanks.

Server Error
SyntaxError: Cannot use import statement outside a module

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
<unknown>
.../node_modules/codemirror-languageserver/dist/index.js (1)
Object.compileFunction
node:vm (352:18)
wrapSafe
node:internal/modules/cjs/loader (1025:15)
Module._compile
node:internal/modules/cjs/loader (1059:27)
Object.Module._extensions..js
node:internal/modules/cjs/loader (1124:10)
Module.load
node:internal/modules/cjs/loader (975:32)
Function.Module._load
node:internal/modules/cjs/loader (816:12)
Module.require
node:internal/modules/cjs/loader (999:19)
require
node:internal/modules/cjs/helpers (93:18)
mbui0327 commented 2 years ago

I figured out that I have installed another codemirror related package that needs a higher version of state and view. So in my local, there are two different version of these modules. Solution: download this github, change the version in packgage.json making sure they are consistent with that of other packages, install manually from local.

hjr265 commented 2 years ago

Updated all dependencies to the latest available in 5f04333d59a9878b12f63af18c847391da61c717.