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.

[Bug] Trying to import modules breaks tests

See original GitHub issue

What version of vite are you using?

3.1.4

System info and storybook versions

Environment Info: System: OS: Linux 6.0 NixOS 22.05 (Quokka) 22.05 (Quokka) CPU: (16) x64 AMD Ryzen 7 PRO 5850U with Radeon Graphics Binaries: Node: 18.9.1 - /nix/store/zvl9fx0mcjrkyy1frxsq86j2gxxrr2qa-nodejs-18.9.1/bin/node Yarn: 1.22.18 - /nix/store/6vm0f48krwxnl6mmi5rh47r97kmxwhng-yarn-1.22.18/bin/yarn npm: 8.19.1 - /nix/store/zvl9fx0mcjrkyy1frxsq86j2gxxrr2qa-nodejs-18.9.1/bin/npm Browsers: Firefox: 106.0.5 npmPackages: @storybook/addon-actions: ^6.5.13 => 6.5.13 @storybook/addon-coverage: ^0.0.5 => 0.0.5 @storybook/addon-essentials: ^6.5.13 => 6.5.13 @storybook/addon-interactions: ^6.5.13 => 6.5.13 @storybook/addon-links: ^6.5.13 => 6.5.13 @storybook/builder-vite: ^0.2.5 => 0.2.5 @storybook/jest: ^0.0.10 => 0.0.10 @storybook/test-runner: ^0.9.0 => 0.9.0 @storybook/testing-library: ^0.0.13 => 0.0.13 @storybook/vue3: ^6.5.13 => 6.5.13

Describe the Bug

so we have a bunch of tests that use storybook and vite - while running the tests we have this error from the storybook webapp:

Cannot read properties of undefined (reading 'length')
    at memoizedBinarySearch (file:///home/athul/testproject/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:9959:25)
    at traceSegmentInternal (file:///home/athul/testproject/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:10062:17)
    at originalPositionFor$1 (file:///home/athul/testproject/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:10049:25)
    at formatError (file:///home/athul/testproject/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:40916:54)
    at TransformContext.error (file:///home/athul/testproject/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:40850:19)
    at Object.transform (file:///home/athul/testproject/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:41106:25)
    at async loadAndTransform (file:///home/athul/testproject/node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:37365:29

Link to Minimal Reproducible Example

No response

Participation

  • I am willing to submit a pull request for this issue.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AthulMuralidharcommented, Nov 16, 2022

yes, i’m working on trying to make a minimal reproducible example - but to answer your question: not really no - not trying to upgrade to 7.0

1reaction
IanVScommented, Nov 16, 2022

Sorry, without a reproduction or some more details, we won’t be able to help much.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug]: Module Import Stack Trace sometimes broken · Issue ...
[Bug]: Module Import Stack Trace sometimes broken #13248 ... From the CLI, run tests: npm run test; See error and stack trace initially...
Read more >
BUG: Import statements in example/jsm examples are broken
I try to fix this by changing the import statement to reference three.module.js and it works! modules/FlyControls.js import { EventDispatcher, ...
Read more >
Importing pure ESM module in TS project fails Jest test with ...
Trying to use the file-type module which is pure ESM in a TS project but my jest fails. I have set the ESM...
Read more >
Testing Your Code - The Hitchhiker's Guide to Python
Always run the full test suite before a coding session, and run it again after. This will give you more confidence that you...
Read more >
1651245 – Broken import test.support - Red Hat Bugzilla
Bug 1651245 - Broken import test.support ... line 1, in <module> File "/usr/lib64/python3.6/test/support/__init__.py", line 36, in <module> ...
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