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.

Collision with `import/extensions`

See original GitHub issue

input

import utils from './lib/utils';
console.log(utils);

errors with Missing file extension for "./lib/utils" import/extensions

When set the file extension

import utils from './lib/utils.js';
console.log(utils);

errors with Unexpected use of file extension "js" for "./lib/utils.js" import/extensions

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:22
  • Comments:15

github_iconTop GitHub Comments

11reactions
Helias17commented, Nov 25, 2020

I’ve solved this problem, when add to .eslintrc.yml next rule: import/extensions: [0, { <js>: "always" }]

read more: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md

5reactions
filetvignoncommented, Jan 23, 2020

This is happening to me right now.

import * as Page from 'components/page/index'; gives me “Missing file extension”. import * as Page from 'components/page/index.js'; gives me “Unexpected use of file extension “js””.

I have no idea what the fix is. Even using eslint rule config of 'import/extensions': [ 'error', 'ignorePackages', { js: 'never', jsx: 'never', }, ] doesn’t solve the problem. I have to set everything to “never” for this to get fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ESLint Definition for rule 'import/extensions' was not found
When two gas molecules collide, can they send out an IR photon? How does a thought imply there is a thinker in "I...
Read more >
TypeError: expected Curve, got Curve - Dynamo + Python
Hi Everybody. I´m trying to create a wall with python node. ... I'm not sure about this error. Python Script got crash: Warning: ......
Read more >
crash on start due to problem loading QtQuick Controls ...
Hi all, I cloned MuseScore (3.x branch tip) and compiled it using CMake on macOS, and then ran cmake --install as in the...
Read more >
Microsoft Edge Browser Policy Documentation
ImportExtensions, Allow importing of extensions ... ShadowStackCrashRollbackBehavior, Configure ShadowStack crash rollback behavior ...
Read more >
eslint-plugin-import
import/extensions ... "settings": { "import/extensions": [ ".js", ".jsx" ] } ... export : add tests for a name collision with export * from...
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