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.

Bundling `@duetds/date-picker` with Rollup doesn't work

See original GitHub issue

Describe the bug Currently @duetds/date-picker does not work with Rollup (or I didn’t get it to). The problem appears to be a dynamic import statement with a template string:

return import(`./${bundleId}.entry.js${""}`);

Rollup seems to ignore these imports: “Dynamic imports on runtime are ignored by Rollup #2463”

To Reproduce Clone this repository https://github.com/sto3psl/rollup-duet-date-picker and follow the steps to create a bundle.

Expected behavior <duet-date-picker></duet-date-picker> should render in the browser with no errors.

Desktop (please complete the following information):

  • OS: macOS 10.15.6
  • Browser: all of them

I’m not sure if this problem comes through duetds/date-picker or Stencil.js or the way everything is published.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
sto3pslcommented, Sep 25, 2020

Well, that works flawlessly! Thanks @WickyNilliams!

I updated my repository and added a note with the “fix” if anyone else runs into this issue. I think it would be great to make it more clear in the docs that the single file bundle is supposed to be used with bundlers and that it also exports defineCustomElements.

1reaction
WickyNilliamscommented, Sep 28, 2020

I’ll reopen this to track the docs changes 😃

It indirectly contains a dynamic import, as it statically imports @stencil/core/internal, which itself contains a dynamic import

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does bundling with Rollup and linking packages ...
Everything works in the component library + Storybook, but when I bundle with Rollup and link the local package ( npm link )...
Read more >
Open Source Version Of Duet Design System's Accessible ...
The final step is to load and register Duet Date Picker in the browser. @duetds/date-picker includes a main function that handles this.
Read more >
Changelog
Tooltip: fix bug where an open tooltip would not close if you click on the trigger button. Tooltip: improve focus management. 4.15.1 #....
Read more >
graphiteds/core - npm Package Health Analysis
Note: All components are part of your bundle, but only lazy-loaded by the browser when ... This doesn't work --> <gr-input v-model="name"></gr-input> <!...
Read more >
Untitled
Suzuki piano book 7, Solo cup lighthouse, Ghq rawalpindi jobs dec 2014, ... Golden retriever puppy doesn't bark, Seerat un nabi ibn kathir...
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