Pinia breaks in sandboxed iframe without localStorage due to devtools-kit import #2993
Unanswered
luizzappa
asked this question in
Help and Questions
Replies: 1 comment
-
Even when setting the This alone causes issues in environments like sandboxed iframes (without ✅ My workaroundIn resolve: {
extensions: [".tsx", ".ts", ".jsx", ".js", ".css", ".wasm"],
alias: {
'@': path.resolve(__dirname, 'src'),
'vue': '@vue/runtime-dom',
'@vue/devtools-api': false // 👈 this is the key
},
}, And in the plugins: plugins: [
new webpack.DefinePlugin({
__VUE_PROD_DEVTOOLS__: 'false',
__USE_DEVTOOLS__: 'false'
}),
] @posva, please consider wrapping the import of |
Beta Was this translation helpful? Give feedback.
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Reproduction
Steps to reproduce the bug
Environment
sandbox
attribute (withoutallow-same-origin
)localStorage
is inaccessible — any access throwsSecurityError
Problem
Even with all devtools disabled (e.g.
__VUE_PROD_DEVTOOLS__
,app.config.devtools = false
), Pinia still imports and initializes@vue/devtools-kit
.When the bundle is loaded, the following error is thrown:
Is there a way to configure Pinia to not import or initialize devtools-kit at all, for environments like sandboxed iframes?
If not, would you consider deferring this logic until after runtime checks are passed, or allowing a config flag to disable the devtools integration entirely?
Expected behavior
Works with sandboxed iframe
Actual behavior
Does not work with sandboxed iframe
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions