parcel can't resolve bundle using dynamic import
Asked Answered
L

0

6

I am using Parcel to bundle my Javascript files. Everything works fine when using the localhost server to test out the build, however in production it doesn't like dynamic imports.

Here is the code snippet that I am importing:

if (condition) {
    await import('./components/modify_root.js');
  } else {
    await import('./components/index_root.js');
  }

My exact error is this. The app.js error is pointing to the second line in the code snippet.

enter image description here

The libraries I am using are PreactJS for frontend framework and node-sass for CSS.

Locket answered 8/7, 2022 at 17:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.