Skip to content

React files not being resolved without extensions #2882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
noelrappin opened this issue Jan 13, 2021 · 2 comments
Closed

React files not being resolved without extensions #2882

noelrappin opened this issue Jan 13, 2021 · 2 comments

Comments

@noelrappin
Copy link

I'm not sure if this is a bug, but seems like a change in behavior from 5 to 6

In 5.x, using React, I could resolve a .tsx or .jsx file with:

import Foo from "components/foo"

In 6.0, with the default configuration and preset-react, I can't do that, I have to do the import as

import Foo from "components/foo.tsx"

Can't tell if this is my error, or a deliberate change of some kind.

Thanks.

@gencer
Copy link
Contributor

gencer commented Jan 13, 2021

Have you tried

// development.js OR base.js
// ...
webpackConfig.resolve.extensions.push('.tsx')
// ...

@rossta
Copy link
Member

rossta commented Jan 13, 2021

@noelrappin Could you try from master? This PR was recently merged and should address your issue #2862

@dhh dhh closed this as completed Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants