Skip to content
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

Relative imports outside of src/ are not supported. #770

Open
auxon opened this issue Aug 31, 2023 · 6 comments
Open

Relative imports outside of src/ are not supported. #770

auxon opened this issue Aug 31, 2023 · 6 comments

Comments

@auxon
Copy link

auxon commented Aug 31, 2023

I get this error on MacOS but not Windows:

Module not found: Error: You attempted to import /Users/rah/repos/web/ReaderCore/WebInterpreter/v3/node_modules/@pmmmwh/react-refresh-webpack-plugin/overlay/index.js which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.
You can either move it inside src/, or add a symlink to it from project's node_modules/.

This is the only module causing this issue. Any ideas?

I updated to the latest version today to see if it would be fixed but it's still a problem.

@pmmmwh
Copy link
Owner

pmmmwh commented Aug 31, 2023

This is an error from react-scripts I believe?

@auxon
Copy link
Author

auxon commented Sep 1, 2023

@pmmmwh I think so; I'm really confused by this one.

@pmmmwh
Copy link
Owner

pmmmwh commented Sep 1, 2023

Can you show more of your setup? Webpack, package.json, or however you are running your app?

@auxon
Copy link
Author

auxon commented Sep 2, 2023

@pmmmwh I made a new create-react-app with typescript installed after the fact, then eject it, and compared my webpack.config.js to the new one and just changed a few lines to put back my required customizations, and suddently it works again. It's very odd. I am trying to track down the difference that broke it.

@auxon
Copy link
Author

auxon commented Sep 2, 2023

Ah, it's the overlay set to true that causes the issue. The default for create-react-app is false, but I switched it to true. I guess there's an issue with this on Macs.

      new ReactRefreshWebpackPlugin({
        overlay: true,
      }),

@auxon
Copy link
Author

auxon commented Sep 2, 2023

@pmmmwh Confirmed ... you can duplicate the issue with a default create-react-app, ejected, and set the overlay to false in the webpack.config.js, but it doesn't seem to be an issue on Windows. I'm running on a Macbook Air M1 2020, with Ventura 13.4.1 (c) (22F770820d).

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

2 participants