-
-
Notifications
You must be signed in to change notification settings - Fork 385
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
ERROR in Invalid value used in weak set against webpack v5 #1114
Comments
I updated my branch ( 1e7cfa0effef ). now you can just run
|
The problem is here - https://github.com/paddymul/buckaroo/blob/chore/fix-codepen/webpack.config.js#L61, you are using the Here how to fix: const path = require('path');
const version = require('./package.json').version;
//import {TsconfigPathsPlugin} from 'tsconfig-paths-webpack-plugin';
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
//import HtmlWebpackPlugin from 'html-webpack-plugin';
const HtmlWebpackPlugin = require('html-webpack-plugin');
const luminoThemeImages = /^.*@lumino\/default-theme.*.png$/;
const crypto = require('crypto');
// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = (algorithm) =>
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);
const performance = {
maxAssetSize: 100_000_000,
};
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const devMode = process.env.NODE_ENV !== 'production';
// Custom webpack rules
const rules = [
{ test: /\.tsx?$/, loader: 'ts-loader' },
{ test: /\.js$/, loader: 'source-map-loader' },
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{
test: luminoThemeImages,
issuer: /\.css$/,
use: {
loader: 'url-loader',
},
},
{
test: /\.(jpg|png|gif|woff|woff2)$/,
exclude: luminoThemeImages,
use: ['file-loader'],
},
{
test: /\.md$/,
use: ['html-loader', 'markdown-loader'],
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
issuer: /\.css$/,
use: {
loader: 'svg-url-loader',
options: { encoding: 'none', limit: 10000 },
},
},
];
// Packages that shouldn't be bundled but loaded at runtime
const externals = ['@jupyter-widgets/base'];
const resolve = {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: ['.webpack.js', '.web.js', '.ts', '.js', '.tsx'],
plugins: [new TsconfigPathsPlugin()],
fallback: { crypto: false },
};
module.exports = [
/**
* Embeddable buckaroo bundle
*
* This bundle is almost identical to the notebook extension bundle. The only
* difference is in the configuration of the webpack public path for the
* static assets.
*
* The target bundle is always `dist/index.js`, which is the path required by
* the custom widget embedder.
*/
{
entry: './js/index.ts',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'amd',
library: 'buckaroo',
publicPath: 'https://unpkg.com/buckaroo@' + version + '/dist/',
},
devtool: 'source-map',
module: {
rules: rules,
},
plugins: [
new MiniCssExtractPlugin()
],
externals,
resolve,
devServer: {
port: 8030,
},
performance,
},
]; Feel free to feedback |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
I get an
ERROR in Invalid value used in weak set
when runningnpm run build
I have looked at the previous bug reports related to this error, and all were tied in some way to webpack v4. even after updating to webpack v5, I see the same
weak set
error.Actual Behavior
Expected Behavior
Here is a shell output from running build
How Do We Reproduce?
Note this is a relatively complex project that builds a jupyterlab extension with typescript and react.
jupyterlab uses module federation. I don't think that is the source of the problem
How I got here
My build works on main, but I'm currently trying to tweak my build so that the npm module works as a standalone in codepen. The project has a whole interactive docs section https://buckaroo-data.readthedocs.io/en/latest/examples/#/DFViewerEx_large that I have been updating.
The edit on codepen buton fails in docs fail because skypack.dev can't import the css file from main. I am trying to fix that bug. I am also experimenting with jsdelivr and esm.sh
My branch where I'm trying to make this work is here:
paddymul/buckaroo#294
Please paste the results of
npx webpack-cli info
here, and mention other relevant informationHere are the results from
webpack-cli info
The text was updated successfully, but these errors were encountered: