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.

Fails on dynamic import

See original GitHub issue

Hello,

When using this to analyze source code for a Vue project, it fails on coming across a Webpack dynamic import.

With tools like ESLint, this is solvable by using babel-eslint as a parser.

Even though I have my ESLint config with babel-eslint plugged into Plato, I still get an Unexpected token error.

This may be solvable by using the parser described by the ESLint options or potentially offering another way to provide one’s own parser. Either that, or I am configuring it wrong.

It looks like the work done in #5 may support this, rather than using typhonjs for parsing which fails to parse dynamic imports.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
the-simiancommented, Feb 12, 2019

@seanohue ok I am still working on this. all I can say is that I can repro it. I get SyntaxError: Unexpected token (18:21) when I hit the first ‘inline’ import statement

1reaction
the-simiancommented, Jan 30, 2019

@seanohue Just popping in to say that I’m going to be implementing a fix related to project dependencies. I’ll be removing Grunt as much as I can, updating globby and also updating the underplaying parser. This, among some other issues, will go away. I’ll post in here when that is done and also THANK YOU for opening this issue and discussing it over this time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

import() - fails when the code is packaged into an executable ...
Dynamic import - import() - fails when the code is packaged into an ... The exe should not crash when dynamically importing an...
Read more >
Dynamic import - import() - fails when the code is packaged ...
I am working in a commonjs environment trying to dynamically import an es module. Consider the below ...
Read more >
[SOLVED] Dynamic import fails when not serving from ...
After setting up an alternate domain for our app, everything looked fine until testing some pages that use dynamic import. I get the...
Read more >
Confusing error message when using dynamic import with ...
If I run import("./foo.js") where foo.js does not exist I already get a good error: TypeError: error loading dynamically imported module.
Read more >
How to Bypass ES Modules Errors in Next.js with Dynamic ...
The error in the image below shows that we can't use the CommonJS approach to import a module. serialize-1. This new standard and...
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