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.

tslib does not provide an export named 'default'

See original GitHub issue

I would have opened this as a bug report but unfortunately I have been so far unable to construct a reproduction outside of the context of my project. I am opening this issue to see if anything has either encountered the same problem or would have an idea on how to narrow down the source to provide a reproduction.

I am getting the following error in the browser console:

Uncaught SyntaxError: The requested module '/node_modules/tslib/tslib.js?v=41e18f12' does not provide an export named 'default'

I have been using Vite 2 on this project from the start and have had no issues, then today, after restarting the server, I got this (completely breaking the application).

Any help would be much appreciated!

Additional information:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
yyx990803commented, Jan 20, 2021

This is a bug in tslib. Its exports field points to an ESM file which in turn imports a UMD file…

Workaround:

// vite.config.js
module.exports = {
  alias: {
    tslib: 'tslib/tslib.es6.js'
  }
}
0reactions
github-actions[bot]commented, Jul 15, 2021

This issue has been locked since it has been closed for more than 14 days.

If you have found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Vite version. If you have any other comments you should join the chat at Vite Land or create a new discussion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Requested module does not provide export named 'default'
To solve the error "The requested module does not provide an export named default", use the `default` keyword when exporting a value from...
Read more >
The requested module does not provide an export named
I'm getting an error when I import the transpiled typescript file in a html script tag. <script> var handlers = {} </ ...
Read more >
does not provide an export named 'default' vite - You.com
The thing you want to do is import vue but it doesnot have a default export function or either the default thing to...
Read more >
TSConfig Option: esModuleInterop - TypeScript
By default (with esModuleInterop false or not set) TypeScript treats CommonJS/AMD/UMD modules similar to ES6 modules. In doing this, there are two parts...
Read more >
How to Solve does not provide an export named 'default'
To solve the error 'does not provide an export name default' in JavaScript, use the default keyword to make it the default export...
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