Unexpected token import
See original GitHub issueEnvironment
Knex version: 0.95.11 Database + version: sqlite3 version 5.0.2 OS: Windows 10
Bug
-
Hi, I am trying to perform the following operation to migrate a database to heroku: heroku run knex migrate:latest -a my-custom-app-name
-
Error message
Unexpected token import
/app/node_modules/knex/lib/migrations/util/import-file.js:11
? import(require('url').pathToFileURL(filepath))
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at openKnexfile (/app/node_modules/knex/bin/cli.js:32:22)
Has anyone encountered a similar error? p.s. I tried to use commonjs instead of es6, it didn’t help, because the error is in the file ./node_modules/knex/lib/migrations/util/import-file.js
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top GitHub Comments
Solved😃
I seem to have found information on this here.
My old settings were as follows:
After that I changed the settings to (same as the updated local version):
But the problem remained.upd: Oooh, I forgot to deploy changes to heroku app. After deployment, everything worked! Thank you!