rails / cssbundling-rails

Bundle and process CSS in Rails with Tailwind, PostCSS, and Sass via Node.js.
MIT License
565 stars 83 forks source link

Issue with windows #90

Closed erniux closed 2 years ago

erniux commented 2 years ago

This is how my package.json looks:

{
  "name": "app",
  "private": "true",
  "dependencies": {
    "@popperjs/core": "^2.11.5",
    "bootstrap": "^5.1.3",
    "bootstrap-icons": "^1.8.1",
    "esbuild": "^0.14.38",
    "sass": "^1.50.1"
  },
  "scripts": {
    "build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds",
    "build:css": "sass ./app/assets/stylesheets/application.bootstrap.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules"
  }

}

When I paste the simple navbar into my application.html.erb and click on the dropdown menu, I got this message in the console:

**Uncaught SyntaxError: Cannot use import statement outside a module**

Please help, I have read in some stackoverflow that this should be fixed adding "type":

"module",

to the package.json: (here)

But cant make the dropdown works :-(

Please help!!!

PS:

This is where the error is sent:

image

dhh commented 2 years ago

Not sure what the issue is, but it's with one of your custom dependencies. Not cssbundling.