-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Detection for accidentalStrictMode results in failures on some platforms #378
Comments
Cocos Creator also has forbidden |
I am having this same problem; using strict CSP with no |
I'm having this problem also. I'm working on a healthcare app and allowing unsafe-eval in the CSP is not an option. I can disable strict mode in the rollup options of my library but this seems like a bad workaround. I feel like strict mode should be able to work, and we shouldn't have to give up the performance optimizations and error detection benefits. |
I think this needs to be revisited. I'm also using toolchains such as I thought I could resolve the issue by using a |
I recently became aware of a very clever Here's another project where I implemented this polyfill, and it's worked perfectly so far: apollographql/invariant-packages#53 For historical reasons, I've tried to keep Any objections to moving forward with that approach? |
For anyone who struggled with this problem: Run this code before globalThis.regeneratorRuntime = undefined |
Also hitting this because of the CSP header not allowing Thanks for providing this great piece of javascript infrastructure in any case! |
I too am struggling with this issue when building for a chrome extension using esbuild. Has anyone got a workaround this? |
Yes, @mikecann You can run this code: globalThis.regeneratorRuntime = undefined Before regenerator is loaded. |
@Jack-Works ye I ended up doing something simmilar thanks to evanw's help: evanw/esbuild#1006 (comment) |
+1 |
Does it progress somehow? I've spent tons of time while found this issue because the bug had appeared only on production deployment with strict CSP rules. And still have no idea how to fix it. I've tried to add an intro banner with |
The trick I mentioned only used to define the global variable and the instantiation of the object should be done by the regenerator-runtime. If any of your code runs before the regenerator-runtime I think it's a bundle error |
Yeah, I'm working to find the problem entry point at the moment. Just mentioned |
Found this issue while trying to load ExcelJS from Salesforce. I have mentioned it in this ExcelJS issue. It seems there is no official solution yet? |
…own [regenerator unsafe-eval issue](facebook/regenerator#378). As far as I could tell our code is not relying on `yield` or generator functions (`function*`), so this should be safe. daily-js and the call machine successfully build. I validated that the change in this commit allowed me to remove the `globalThis.regeneratorRuntime = undefined` workaround from our Modern Wordfare demo.
…sform, avoiding the known [regenerator unsafe-eval issue](facebook/regenerator#378). As far as I could tell our code is not relying on `yield` or generator functions (`function*`), so this should be safe. The build tool TSDX depends on Babel and the problematic transform. Fortunately, TSDX [supports](https://github.com/jaredpalmer/tsdx#babel) specifying a partial `.babelrc` which is automatically merged into its default Babel configuration. I sanity-checked that Babel `'preset-env'` option merging works as expected by adding logging to TSDX. This is the same fix we already applied to daily-js and the call machine in [this commit](daily-co/pluot-core@a98e54b).
Fix in #450 ? |
Some Javascript runtime like Wechat MiniProgram and Alipay MiniProgram forbids dynamically defining function (related documents), where both
Function
andeval
areundefined
.Recently added detection for
accidentalStrictMode
usedFunction
as a rescue, which results in failures.Is there better way to detect
accidentalStrictMode
or just bypass it?The text was updated successfully, but these errors were encountered: