Skip to content
Snippets Groups Projects
Unverified Commit 0f306ca5 authored by Uladzimir Havenchyk's avatar Uladzimir Havenchyk Committed by GitHub
Browse files

fix CSP error in prod (#46890)

parent 28e5fac9
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,9 @@ import "metabase/plugins/builtin";
// If EE isn't enabled, it loads an empty file.
import "ee-plugins"; // eslint-disable-line import/no-duplicates
// Set nonce for mantine v6 deps
import "metabase/lib/csp";
import { createHistory } from "history";
import { DragDropContextProvider } from "react-dnd";
import HTML5Backend from "react-dnd-html5-backend";
......
import "cljs/metabase.util.devtools";
/**
* setNonce is required for react-remove-scroll which adds style and can handle
* nonce but the method we use to set nonce is not compatible with
* react-remove-scroll it expects __webpack_nonce__ to be defined, when we
* generate it at BE and put directly into html file. `get-nonce` is used inside
* react-remove-scroll to get nonce, so we put it manually here.
* react-remove-scroll is a dependency of mantine v6
*/
import { setNonce } from "get-nonce";
setNonce(window.MetabaseNonce);
/**
* setNonce is required for react-remove-scroll which adds style and can handle
* nonce but the method we use to set nonce is not compatible with
* react-remove-scroll it expects __webpack_nonce__ to be defined, when we
* generate it at BE and put directly into html file. `get-nonce` is used inside
* react-remove-scroll to get nonce, so we put it manually here.
* react-remove-scroll is a dependency of mantine v6
*
* TODO: remove it when we upgrade mantine to v7
*/
import { setNonce } from "get-nonce";
setNonce(window.MetabaseNonce);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment