-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Error: You may need an appropriate loader to handle this file type for shared content #4161
Comments
It seems link you're right about it being an issue with the symlink: I tried using yarn link instead of local file dependency, but that didn't seem to work either - The JSX isn't being transformed by the loader when it's resolved through a symlink. Edit: It seems like there is a pretty lengthy discussion about this in a previous issue... you might want to take a look and see if you can't find a resolution: Good luck! |
Thanks @sowhatdoido for the useful links. In fact, I've browsed around tons of posts about symlink problems with CRA, babel and webpack and tried very different things (ejecting, After reading all this stuff and I decided to abandon my approach and move to lerna as officialy recommended from CRA team here. |
I'm glad you found a solution! Just for future reference, this issue only occurs when you're trying to create a local file dependency for parallel development in a pre-published phase for both projects. If you can push the One way I would have tackled this problem personally is I would have published |
@sowhatdoido This is one approach I´m aware of (publising Thanks for the comment |
I happened on this error with Lerna (using yarn workspaces) when using Babel in multiple packages. I resolved it by adding babel-loader to the nohoist-array in the main package.json. my-monorepo/lerna.json:
my-monorepo/package.json:
|
This is a create-react-app limitation See also: - facebook/create-react-app#1333 - facebook/create-react-app#3685 - facebook/create-react-app#4161
I´m working with 2 CRA projects. A
shared
library of components, and the final applicationmyapp
. To build this use case I´ve just built a simple shared component:And on
myapp
project, I do import and use it:To use
shared
insidemyapp
, I´ve installedshared
atmyapp
folder as:$ npm install --save ../shared
Doing that I´ve found that node generated a
shared
symlink insidenode_modules
folder.When running
myapp
I got this error:This problem is making me crazy. Seens that is something related to symlinks, but I don´t know how to solve. Please advice.
Sampe code:
usecase.zip
The text was updated successfully, but these errors were encountered: