Closed philippsiegmund closed 5 years ago
I get 'WeakSet' not found
This seems like something thrown from one of your vendored dependencies (e.g. node_modules). Also - the CoreJS import would seem to need to be weak-set additionally, e.g.
import 'core-js/modules/es.weak-set'
Would you be able to share a reproduction? Even a URL would be helpful, as well.
Thanks!
Thanks for your reply!! I will try to get a nullified version online, but cannot promise..
I added core-js to the .babelrc, hoping that "some kind of magic" happens... Downgrading i18n-next, up- and downgrading gatsby, gatsby-cli, yarn, no success with my combinations.
The WeakSet problem is minor imho, because this only happens on gatsby develop
, but I will try it to minimize any sources of error and chaos.
The .babelrc
:
{
"presets": [
[
"@babel/preset-env",
{
"loose": true,
"modules": false,
"corejs": 2,
"useBuiltIns": "usage",
"shippedProposals": true,
"targets": {
"browsers": [">0.25%", "not dead"]
}
}
],
[
"@babel/preset-react",
{
"useBuiltIns": true,
"corejs": 2,
"pragma": "React.createElement"
}
]
],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }],
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
],
"@babel/plugin-syntax-dynamic-import",
"babel-plugin-macros",
[
"@babel/plugin-transform-runtime",
{
"helpers": true,
"regenerator": true
}
]
]
}
Another try was to modify the webpack config via gatsby-node.js
with something like:
exports.onCreateWebpackConfig = ({ stage, getConfig, actions }) => {
const config = getConfig()
switch (stage) {
case 'build-javascript':
const app =
typeof config.entry.app === 'string'
? [config.entry.app]
: config.entry.app
console.log(config)
config.entry.app = ['core-js/features/array/from', 'core-js/features/promise', 'core-js/features/set', 'core-js/features/weak-set', ...app]
}
actions.replaceWebpackConfig(config)
}
But this led to other problems, where the internet suggested switching to core-js@3, which led to other problems, chasing down the rabbit hole..
Hiya!
This issue has gone quiet. Spooky quiet. 👻
We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contributefor more information about opening PRs, triaging issues, and contributing!
Thanks for being a part of the Gatsby community! 💪💜
Hey again!
It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY
. Please feel free to reopen this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!
Thanks again for being part of the Gatsby community!
We know look for polyfills in node_modules as well.
Published in gatsby@2.11.0
Ran into this Weakset IE11 issue on Gatsby 2.19.45. Fixed it with gatsby-plugin-compile-es6-packages.
framesync
was the module causing trouble for me so my gatsby-config.js entry looked like this and then it worked.
{
resolve: `gatsby-plugin-compile-es6-packages`,
options: {
modules: [`framesync`],
},
},
Summary
Hey there! I have problems building our page for IE11. But there seem to more underlying issues as well and I think it comes from webpack or ES6 in modules or similar. While starting with 'gatsby develop' I get 'WeakSet' not found, so I started manipulating with .babelrc and core-js, I tried core-js2 and 3, in devDependecies, in dependencies, I tried to change the webpack config, and currently I get the page builded on IE11 without google fonts, without Lottie animations, because gatsby mistakenly taken those as Graph Data.
I also found an open PR, which seems to modify the webpack config for ES6 modules, but currently I am happy for any input!
Best regards,
Philipp!
Environment (if relevant)
System: OS: macOS 10.14.4 CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz Shell: 5.3 - /bin/zsh Binaries: Node: 10.14.1 - /usr/local/bin/node Yarn: 1.15.2 - /usr/local/bin/yarn npm: 6.7.0 - /usr/local/bin/npm Browsers: Chrome: 73.0.3683.103 Firefox: 66.0.2 Safari: 12.1 npmPackages: gatsby: ^2.3.23 => 2.3.23 gatsby-cli: ^2.4.11 => 2.5.8 gatsby-image: ^2.0.29 => 2.0.39 gatsby-plugin-copy-files: ^1.0.1 => 1.0.1 gatsby-plugin-manifest: ^2.0.16 => 2.0.29 gatsby-plugin-offline: ^2.0.25 => 2.0.25 gatsby-plugin-react-helmet: ^3.0.5 => 3.0.12 gatsby-plugin-sharp: ^2.0.19 => 2.0.34 gatsby-plugin-styled-components: ^3.0.5 => 3.0.7 gatsby-plugin-web-font-loader: ^1.0.4 => 1.0.4 gatsby-source-filesystem: ^2.0.19 => 2.0.29 gatsby-transformer-json: ^2.1.7 => 2.1.11 gatsby-transformer-remark: ^2.2.3 => 2.3.8 gatsby-transformer-sharp: ^2.1.13 => 2.1.18
File contents (if changed)
gatsby-config.js
:package.json
:gatsby-browser.js
gatsby-ssr.js
: