Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bundler] Multiple import() statements for the same fragment breaks bundles #568

Closed
keanulee opened this issue Jul 9, 2018 · 8 comments
Closed

Comments

@keanulee
Copy link
Contributor

keanulee commented Jul 9, 2018

When I edit:

https://github.com/Polymer/pwa-starter-kit/blob/b50a93748677c8be0bdcdc5ed71a03747628fc57/src/actions/app.js#L31-L39

  switch(page) {
    case 'view1':
      import('../components/my-view1.js').then((module) => {
        // Put code in here that you want to run every time when
        // navigating to view1 after my-view1.js is loaded.
      });
      break;
    case 'view2':
      import('../components/my-view2.js');
      break;

To:

    case 'view1':
      import('../components/my-view1.js').then((module) => {
        // Put code in here that you want to run every time when
        // navigating to view1 after my-view1.js is loaded.
      });

      import('../components/my-view2.js');

      break;
    case 'view2':
      import('../components/my-view2.js');
      break;

The resulting shell bundle (my-app.js) doesn't export some identifiers used by the fragments like LitElement and html.

Ref Polymer/pwa-starter-kit#190

@abdonrd
Copy link
Contributor

abdonrd commented Jul 21, 2018

@usergenic any news about this? 🙂

@LarsDenBakker
Copy link
Contributor

This is a serious bug, not very encouraging that it's been open since july :(

@RobMaskell
Copy link
Contributor

Strangely hit this two days ago and it took a while to unwind it

@usergenic
Copy link
Contributor

FWIW, working on this via #722 - rollup has some unfortunate assumptions and its own new logic around deduplicating dynamic imports that I'm attempting to get around. Solution soon.

@usergenic
Copy link
Contributor

Filed a bug on rollup rollup/rollup#2487

1 similar comment
@usergenic
Copy link
Contributor

Filed a bug on rollup rollup/rollup#2487

@usergenic
Copy link
Contributor

Filed another bug on rollup rollup/rollup#2489

@usergenic
Copy link
Contributor

Fixed by #722

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants