Console Syntax Error after installing and then removing Rails gem cocoon

32 Views Asked by At

I installed a rails gem called cocoon by nathanvda using these instructions

It did not work for me so I uninstalled it by deleting the line from the gem file and running bundle install.

However, now my nav menu (which has js in the application.js file) does not work.

The console has an error:

Uncaught SyntaxError: Cannot use import statement outside a module and then points me to a line of code that says: import "@nathanvda/cocoon" that is supposedly right above where my nav bar code is in application.js file.

However, this line of code is not actually there. I've checked. The file the console points to does not exist and I thought I uninstalled cocoon.

How can I completely remove cocoon and this line of code, and will this fix the navbar issue (which was working before cocoon).

Looking at the installation instructions I think the source of the issue might have been from running the line:

bin/importmap pin @nathanvda/cocoon

That's supposed to add something to the importmap file, but nothing new is there.

0

There are 0 best solutions below