vilarfg / query-string-lite

MIT License
0 stars 0 forks source link

Import error #2

Closed lishine closed 4 years ago

lishine commented 4 years ago
[server] /usr/app/api/node_modules/query-string-lite/index.js:9
[server] export function decode(querystring) {
[server] ^^^^^^
[server]
[server] SyntaxError: Unexpected token 'export'
[server]     at wrapSafe (internal/modules/cjs/loader.js:1167:16)
[server]     at Module._compile (internal/modules/cjs/loader.js:1215:27)
[server]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1272:10)
[server]     at Module.load (internal/modules/cjs/loader.js:1100:32)
[server]     at Function.Module._load (internal/modules/cjs/loader.js:962:14)
[server]     at Module.require (internal/modules/cjs/loader.js:1140:19)
[server]     at require (internal/modules/cjs/helpers.js:75:18)
[server]     at Object.<anonymous> (/usr/app/api/dist/utils/utils.js:5:29)
[server]     at Module._compile (internal/modules/cjs/loader.js:1251:30)
[server]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1272:10)
[server] [nodemon] app crashed - waiting for file changes before starting...
[tsc-watch] [6:00:58 PM] Found 0 errors. Watching for file changes.
[tsc-watch]
^C
[server] yarn run server exited with code SIGINT
--> Sending SIGTERM to other processes..
➜  api git:(server) ✗ [tsc-watch] yarn run tsc-watch exited with code SIGINT
node -v
node -v
v14.8.0
➜  api git:(server) ✗
vilarfg commented 4 years ago

query-string-lite uses ES6 modules... I have no need for anything else, so...

lishine commented 4 years ago

What configuration should be in order to import ES6 modules? maybe Package settings maybe tsconfig settings running Node 14.8

vilarfg commented 4 years ago

I am not sure, but TypeScript should be able to handle this as is. If you don't use TypeScript, I think (not sure though) all major bundlers (Rollup, Webpack) should also be able handle this as is. I don't know your setup...

vilarfg commented 4 years ago

@lishine a quick google search will help you more than me in this regard TBH :joy: Stack Overflow

vilarfg commented 4 years ago

@lishine I just published v0.2.2 on npm, I believe this import business should have been fixed. Please let me know if it worked for you :wink:

lishine commented 4 years ago

Thanks, now it works