question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error 'does not contain a default export (imported as 'PaintFilterWorker')' when i import method from 'react-vtkjs-viewport'

See original GitHub issue

i use create-react-app and use this module. But when i import it will show this error:

./node_modules/vtk.js/Sources/Filters/General/PaintFilter/index.js Attempted import error: ‘vtk.js/Sources/Filters/General/PaintFilter/PaintFilter.worker’ does not contain a default export (imported as ‘PaintFilterWorker’).

Please help me fix this issue.

"react-vtkjs-viewport": "^0.14.2",
"vtk.js": "^16.1.1"
"scripts": {
    "start": "rescripts start",
    "build": "rescripts build",
    "test": "rescripts test",
    "eject": "rescripts eject"
  },

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
muakdogancommented, Feb 5, 2021

Struggling with the same issue. I’m using Craco instead of Rescripts and it’s config is as follows:

var vtkRules = require("vtk.js/Utilities/config/dependency.js").webpack.core
  .rules;

module.exports = () => {
  const config = {
    module: {
      rules: [
        {
          test: /\.(js|jsx)$/,
          exclude: /node_modules/,
          use: "babel-loader",
        },
        {
          test: /\.css$/,
          use: ["style-loader", "css-loader"],
        },
      ].concat(vtkRules),
      loaders: [
        { test: /\.styl$/, loader: "style-loader!css-loader!stylus-loader" },
      ],
    },
    devServer: {
      historyApiFallback: true,
    },
  };
  return config;
};

0reactions
cre-mercommented, Apr 6, 2022

Struggling with the same issue. I’m using Craco instead of Rescripts and it’s config is as follows:

var vtkRules = require("vtk.js/Utilities/config/dependency.js").webpack.core
  .rules;

module.exports = () => {
  const config = {
    module: {
      rules: [
        {
          test: /\.(js|jsx)$/,
          exclude: /node_modules/,
          use: "babel-loader",
        },
        {
          test: /\.css$/,
          use: ["style-loader", "css-loader"],
        },
      ].concat(vtkRules),
      loaders: [
        { test: /\.styl$/, loader: "style-loader!css-loader!stylus-loader" },
      ],
    },
    devServer: {
      historyApiFallback: true,
    },
  };
  return config;
};

Did you find a solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does not contain a default export Error in React.js | bobbyhadz
The "does not contain a default export" error occurs when we try to use a default import to import from a module that...
Read more >
does not contain a default export even after being correctly ...
The problem is that you are trying to import a default module (which was exported using export default ), but you didn't export...
Read more >
Attempted import error: does not contain a default export
Blog : Referencehttps://progvocab.blogspot.com/2020/01/attempted- import - error - does - not - contain.html.
Read more >
[Problem Solving] ./src/firebase.js Attempted import error ...
src/firebase.js Attempted import error: 'firebase/app' does not contain a default export (imported as 'firebase'). Web. melonicedlatte; Oct 04, 2021.
Read more >
Export and Import - The Modern JavaScript Tutorial
A module has either named exports or the default one. As there may be at most one default export per file, the exported...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found