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.

import/no-unresolved with webpack modules/aliases in the VS Code

See original GitHub issue

Update:

So, there are few separate issues.

  1. To fix issue now, I can adjust my config: replace object spreading with Object.assign, or use babel-register.
  2. Something interpret Unexpected token ... as ESLint error and show no-undesolved, no-duplicate and other. 2018-05-10 19 55 21 Which is wrong - it should be SyntaxError in ESLint output. index js__marketnode-2018-05-10-19-53-42-osox6 It happens because node v7.9.0 in VS Code can’t launch webpack config with object spread syntax.
  3. May be vscode-eslint can launch .eslintrc.js and webpack config with local node, not with bundles one?

Original text

Faced with such issue. There is no errors while launching eslint from terminal.

2018-05-07 15 39 51 2018-05-07 15 40 02

Trying to reproduce error in clean repository, but without success yet.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:15
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

13reactions
alecfcommented, May 7, 2018

This was driving me bonkers and I was getting other odd errors from the import plugin. Just for kicks I put:

require('babel-register')

at the top of my .eslintrc and magically everything seems to work now! (I was already using babel-register elsewhere in my project, so it was already installed)

It seems like vscode-eslint runs eslint as a library, and JS imports aren’t recognized without babel-register

3reactions
viT-1commented, Feb 14, 2019

I changed webpack config from this: resolve: { alias: { '~': path.resolve(__dirname), '@': path.resolve(__dirname, './src'), }, }, to this: resolve: { alias: { '~': path.resolve(__dirname), '@': path.resolve(__dirname, 'src'), }, },

It seems to be ok. But intellisence not showing fresh added methods in imported file, but show arguments intellisence after I writing the name of “fresh” method completely.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solve Module Import Aliasing for Webpack, Jest, and VSCode
Complication 1: While Webpack knows how to resolve these aliases now, VS Code doesn't, so tools like Intellisense won't work.
Read more >
Make VS code read webpack.config and recognize path with ...
I do have VSCode (1.3.1) recognizing webpack's aliases in js files. Aliases do not work in typescript. Are you talking about javascript or...
Read more >
Bundling Extensions - Visual Studio Code
Webpack is a development tool that's available from npm. To acquire webpack and its command line interface, open the terminal and type:
Read more >
jsconfig.json Reference - Visual Studio Code
For IntelliSense to work with webpack aliases, you need to specify the paths keys with a glob pattern. For example, for alias 'ClientApp':...
Read more >
React JavaScript Tutorial in Visual Studio Code
To open your React application in VS Code, open another terminal or command ... If you are using webpack together with your React...
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