question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Unexpected token import" when using symlinks

See original GitHub issue

I’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:open
  • Created 6 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
quoostoncommented, Mar 12, 2018

Ok I’ll give that a go.

On Mon, 12 Mar 2018, 21:19 Alexander-Taran, notifications@github.com wrote:

@quooston https://github.com/quooston might me npm issue btw. do you have yarn installed? If not can you try with installing yarn and rescaffolding with au new?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aurelia/cli/issues/830#issuecomment-372259287, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD4tCi--4F38CJDNmixvzPzm3d08OdQks5tdkumgaJpZM4SR1dx .

0reactions
Alexander-Tarancommented, Apr 10, 2018

@joonhwan do you also use symlinks ?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found