Importing modules - "This code cannot be interpreted as javascript..."

import is not supported by bubble, i’m guessing its because they’re using an old version of node.

you have two options

  • look for a cjs version of the module
  • use this package, require it first and then import your module via require syntax → fix-esm - npm

use it like this

make sure you add fix-esm to your dependencies

Screenshot 2022-10-12 at 22.28.12

1 Like