Can't use Elm asset when there is a Content Security Policy #5351
Unanswered
rachel-barrett
asked this question in
Q&A
Replies: 2 comments 1 reply
|
Actually, to be more accurate, this issue only seems to affect |
0 replies
|
Hi, @rachel-barrett! I recently started an Electron + Elm app, too, and ran into the same problem. 😢 I know that this is like five years to late for you, but I fixed that problem (and a couple others, and added headless Elm support) to a fork of the If you have the time and inclination, please upvote #10255 so we can get this added as the new dependency in |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi.
I'm making use of Parcel's built in support for Elm.
I'm doing this as part of an Electron app, which warns me if I have not set a content security policy in my 'index.html'.
But when I add the content security policy (
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />), the Elm injection using parcel is blocked. (The error message in the console says the unsafe eval is happening atElm.Main.init>isFullScreenApp>elmSybol.)This issue does not happen when I compile the Elm code directly without Parcel (using
Elm make src/Main.elm --output src/elm.js).So am I right to assume this is an issue with Parcel's support for Elm?
Is there anything I need to configure, or does this require a code change to Parcel?
I've created a minimal project that reproduces this issue here (commit 0b700e768d11a0a3abc66ffcacab6750a1ff8196).
All reactions