Auth0 when using Worker-Plugin and React

Hi

I have a problem with Auth0 wih worker-plugin and React (with removing Auth0 everything is ok).

Here is the error

./node_modules/@auth0/auth0-react/dist/auth0-react.esm.js
Module parse failed: Cannot read property 'length' of undefined
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.

… and my babel config (with react-app-rewired)

config.module.rules.push({
    exclude: /node_modules/,
    test: /\.worker\.js$/,
    use: [
        {
        loader: "babel-loader",
            options: {
                presets: ["@babel/preset-react"],
                plugins: ["@babel/plugin-syntax-jsx", "inline-json-import", "transform-class-properties", '@babel/plugin-transform-flow-strip-types'],
            },
        },
    ],
});
config.plugins.push(new WorkerPlugin({
    preserveTypeModule:true
}));

If you would have any ideas it would be great
Thanks
S

It was due to a case from worker-plugin, here is the PR Fix `Module parse failed: Cannot read property 'length' of undefined` by jebbench · Pull Request #94 · GoogleChromeLabs/worker-plugin · GitHub.

1 Like

Perfect and thanks for sharing it with the rest of community!