-
-
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
Script tags with relative url unexpected token < #577
Comments
What are you trying to do? This was never officially supported. It accidentally worked in versions before 0.4.0 but only worked in development. Normally you should just |
I'm using a module (js-ipfs-api) which requires fs shims to run in browser and would prefer not to eject. I'll host it remotely for now and wait for its webpack incompatibilities to be resolved. |
Let's keep this open for now. Maybe we can configure Webpack to include more sensible shim for fs. I've seen this problem a couple of times and I think there was some solution. |
Related: #573 |
I drafted a proposal to solve this in #703. Unless we find some fatal flaws, it should come out in 0.5.0. Let me know what you think! |
Closing as this is fixed, and will be released in 0.5.0. |
This is now supported in 0.5.0. Read about using the new See also migration instructions and breaking changes in 0.5.0. |
Adding a script tag with a relative src throws
SyntaxError: Unexpected token <
To reproduce,
create-react-app
then add this line to index.html:<script type="text/javascript" src="test.js"></script>
File should look like this:
npm start
and chrome will throwindex.js:1 Uncaught SyntaxError: Unexpected token <
If I replace the src with an absolute url, for example https://npmcdn.com/ipfs-api/dist/index.js, the error goes away.
The text was updated successfully, but these errors were encountered: