Topic: Rails / Webpack(er) / yarn Cannot assign to read only property 'exports'

erikmjacobs free asked 4 years ago

I am trying to migrate my app to using webpack(er) and Rails 5.2.4 and am having similar issues to ones reported previously. However I am not (to my knowledge) using Laravel or Symphony. I have a very simple/vanilla Rails installation.

I tried to follow some of the instructions here as they made sense for Rails to the best of my abilities:

I also looked at his code repo. I was trying to make 4.8.9 work but was hitting the _classCallCheck issue reported here:

I tried to update to 4.15.0 and that solved the _ClassCallCheck issue, but then I hit:

This doesn't appear to be resolved.

The above refers to attempting to modify the Babel config, which I did, and my .babelrc looks like the following:

  "presets": [
        "useBuiltIns": "usage",
        "corejs": "3.0.0"
  "plugins": [
        "decoratorsBeforeExport": true
        "proposal": "minimal"

Most of the above exists because the webpack config post suggests it.

if you scroll down to the post by joulien moulin where he manually imports mdb from the zip file, I tried just using MDB and that didn't work -- I still got the error.

However, I then did both bootstrap.min and mdb from the zip, and removed bootstrap from my package.json, and that seemed to work.

Now, I don't get any explicit error, but I do see a warning:

Velocity is already loaded. You may be needlessly importing Velocity again; note that Materialize includes Velocity.

Any thoughts? This doesn't seem serious. However not being able to install mdbootstrap-pro via Yarn is kind of annoying.

Grzegorz Bujański staff commented 4 years ago

Hi. Do you use materialize css on You project? Can you show me dependencies and dev-dependencies from your package.json file?

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.15.0
  • Device: Laptop
  • Browser: Chrome
  • OS: Linux
  • Provided sample code: Yes
  • Provided link: Yes