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 when execute test "Failed to fetch dynamically imported module"

See original GitHub issue

I am trying to replace karma by wtr but I have the following errors when I launching tests:

test/dt-crm-export-contacts.test.js:

 ❌ TypeError: Failed to fetch dynamically imported module: http://localhost:9264/test/dt-crm-export-contacts.test.js 

test/dt-crm-export.test.js:

 ❌ TypeError: Failed to fetch dynamically imported module: http://localhost:9264/test/dt-crm-export.test.js 

test/dt-crm-export-item.test.js:

 ❌ TypeError: Failed to fetch dynamically imported module: http://localhost:9264/test/dt-crm-export-item.test.js 

test/dt-crm-export-validation.test.js:

 ❌ TypeError: Failed to fetch dynamically imported module: http://localhost:9264/test/dt-crm-export-validation.test.js 

Chrome: |██████████████████████████████| 4/4 test files | 0 passed, 0 failed

Test coverage: NaN %
View full coverage report at coverage/lcov-report/index.html

Error while running tests.

Versions:

    "@web/test-runner": "^0.6.36",
    "@web/test-runner-chrome": "^0.5.9",

conf:

// eslint-disable-next-line
const { chromeLauncher } = require('@web/test-runner-chrome');

module.exports = {
  files: ['test/**/*.test.js'],
  preserveSymlinks: true,
  nodeResolve: true,
  browsers: chromeLauncher({ args: ['--no-sandbox'] }),
  coverage: true,
  testRunnerHtml: (testRunnerImport) => `
    <html>
      <body>
        <script type="module">
          window.process = { env: { NODE_ENV: 'production' } };
        </script>

        <script type="module">
          import '${testRunnerImport}';
        </script>
      </body>
    </html>
  `,
};

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
LarsDenBakkercommented, Jul 20, 2020

I see… this might be an issue on our side because we resolve .ts files over .js files. I’ll check what other tools do here.

0reactions
RoXuScommented, Jul 20, 2020

Clearly! It is not the best tool for testing…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to fetch dynamically imported module" on Vue/Vite ...
It seems like the errors are correlated in time with new deployment to prod, although I don't have enough data to confirm. It...
Read more >
Failed to fetch dynamically imported module #1144 - GitHub
This error happens when you have an error in your code which is causing a module import to fail. There were no breaking...
Read more >
Failed to fetch dynamically imported module | Blazor Forums
Are you modified your base path of your application? · Is this sub path hosted application? · Are there any errors in browser's...
Read more >
vite typeerror: failed to fetch dynamically imported module
I believe this error is similar to the 'ChunkLoadError' ( which is also faced in many other framework, not just React), attaching a...
Read more >
Error: Failed to fetch dynamically Dashboard imported module
Error : Failed to fetch dynamically Dashboard imported module · Uninstall TBM · Go to installation folder and delete everything except: \resources\ ...
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