Replies: 3 comments 7 replies
-
@kentcdodds Do you know how CSP works for the dynamic script import for Epic Stack? I think you might be the best equipped to answer this question. |
Beta Was this translation helpful? Give feedback.
-
@kentcdodds I figured it out! It's the single fetch future flag:
So, it has nothing to do with Fastify or this server file and in fact the bug would exist on Epic Stack if enabled this flag. I don't know enough about Remix internals to know why this breaks it, but it seems like something the Remix team should fix before single fetch becomes the standard. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I am using a modified version of Epic Stack that uses Fastify instead of Express. Here is my repo. You can run it with just
npm install
andnpm run dev
, no need to get any enviornment variables set up. I am trying to get CSP working with nonce but I'm having problems with the dynamically importedentry.client.tsx
that appears like this:It has the right nonce value and the other scripts are loading fine, but maybe there is something weird about dynamic imports? I don't quite understand how they are supposed to work with nonces and CSP rules and obviously this is all baked into Remix. Here is the error I'm getting in the browser:
The setup with helmet and nonce handling is pretty much exactly the same as with Epic Stack, but for some reason I'm getting this error. All the other scripts are loading just fine but the
entry.client.tsx
is giving me lots of problems. What's going on here?Beta Was this translation helpful? Give feedback.
All reactions