"Unexpected token import" when using symlinks
See original GitHub issueI’m submitting a bug report
- Library Version: CLI: 0.32.0
Please tell us about your environment:
-
Operating System: Windows 10 Pro
-
Node Version: 9.5.0
-
NPM Version: 5.6.0
-
Browser: N/A
-
Language: ESNext
-
Loader/bundler: SystemJS and RequireJS
Current behavior:
au new --here
does it’s thing. After installing dependencies, I run au build
, and get the error:
(function (exports, require, module, __filename, __dirname) { import gulp from 'gulp';
^^^^^^
SyntaxError: Unexpected token import
at new Script (vm.js:51:7)
at createScript (vm.js:138:10)
at Object.runInThisContext (vm.js:199:10)
at Module._compile (module.js:624:28)
at Module._extensions..js (module.js:671:10)
at Object.require.extensions.(anonymous function) [as .js] (d:\code\scratch\meh\node_modules\babel-register\lib\node.js:152:7)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Module.require (module.js:604:17)
I have just recently reformatted my machine, this is a fresh box with everything installed first time.
I have a .babelrc file (put there by the CLI):
{
"sourceMap": true,
"sourceRoot": "src",
"moduleIds": false,
"comments": false,
"compact": false,
"code": true,
"presets": [
["es2015", {"loose": true}],
"stage-1"
],
"plugins": [
"syntax-flow",
"transform-decorators-legacy",
"transform-flow-strip-types"
]
}
-
What is the expected behavior? I’d like it to build!
-
What is the motivation / use case for changing the behavior? 😐
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
Importing symlinked components error: Module parse failed ...
If I import anything from shared_lib other than a file with jsx - for example, a string or a function, etc. - it...
Read more >API - esbuild
To join a set of files together with esbuild, import them all into a single entry point file and bundle just that one...
Read more >TypeScript Jest: Unexpected Token Export - Reddit
I'm trying to run unit tests for a TypeScript project which uses another TypeScript project I've created as a dependency.
Read more >Babel unexpected token import - Residenza Colle Oliva
To solve the error, use the Unexpected token import with Jest (babel-eslint not available from tested file, symlink env). SyntaxError: Unexpected token ......
Read more >Configuring Jest
Use the <rootDir> string token to include the path to your project's root directory. JavaScript; TypeScript. /** @type {import('jest').Config} ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok I’ll give that a go.
On Mon, 12 Mar 2018, 21:19 Alexander-Taran, notifications@github.com wrote:
@joonhwan do you also use symlinks ?