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.

Uncaught SyntaxError: The requested module '../../node_modules/lottie-web/build/player/lottie.js' does not provide an export named 'default'

See original GitHub issue

Browser and Browser Version: Chrome, Version 80.0.3987.122 (Official Build) (64-bit)

What did you do? Please explain the steps you took before you encountered the problem. I followed this tutorial https://josephkhan.me/lottie-web/: npm install lottie-web and then import lottie from 'lottie-web';

Then in the constructor() of the web component, I did the following:

this.anim= lottie.loadAnimation({
      container: this.shadowRoot.getElementById('anim'), 
      renderer: 'svg',
      loop: true,
      autoplay: true,
      animationData: './anim.json'
});

Later I start playing it: this.anim.play()

What did you expect to happen? It works.

What actually happened? Please include as much relevant detail as possible. When the parent component appears, it does not render/show up. Instead there is this red error line in the console: Uncaught SyntaxError: The requested module ‘…/…/node_modules/lottie-web/build/player/lottie.js’ does not provide an export named ‘default’

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

9reactions
mikicofcommented, Aug 6, 2020

I’ve encountered the same error, it is because this does not provide a fully ES6 module.

It does when built via Webpack using the package.json main path and converting the file found into an ESM, but now that we have changed to Rollup.js we found out that we are unable to use it as a module.

Can you provide also an ES6 module?

Thank you

3reactions
michtiocommented, Nov 29, 2021

Bit poor to close this issue @bodymovin I think for modern builds and SSR apps it does need a full ES6 module / support.

You closed an issue with “just use the CDN” in certain situations, CDN usage isn’t preferably. Currently this package is also useless with vite.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The requested module '' does not provide an export named ...
When I try adding my own export in TableCsv.js it says A module cannot have multiple default exports.ts(2528). Here is my code. main.js...
Read more >
Uncaught SyntaxError: The requested module 'events.js' does ...
pnpm/events@3.3.0/node_modules/events/events.js?v=be595b23' does not provide an export named 'default' when opening the project in a browser.
Read more >
the requested module does not provide an export named
The reason it didn't work is that Vue provides a named export, whereas you are trying to import it as though it had...
Read more >
Snowpack - The requested module '/web_modules/recoil.js ...
Uncaught SyntaxError : The requested module '/web_modules/recoil.js' does not provide an export named 'RecoilRoot'. I will talk about how to ...
Read more >
Requested module does not provide export named 'default'
js , but when we imported the function in the other file, we used a default import. This is the reason the error...
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