Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Can't resolve '@stimulus/multimap' #8

Open
tawanda opened this issue May 18, 2021 · 0 comments
Open

Error: Can't resolve '@stimulus/multimap' #8

tawanda opened this issue May 18, 2021 · 0 comments

Comments

@tawanda
Copy link

tawanda commented May 18, 2021

Hi, thanks for building this library, cant wait to test it out, however I Followed setup instructions, I get this error

In template /Users/tawanda/source/playground/django-sockpuppet-expo/core/templates/base.html, error at line 17

ModuleNotFoundError in Module not found: Error: Can't resolve '@stimulus/multimap' in 
'/Users/tawanda/source/playground/django-sockpuppet-expo/.yarn/cache/@stimulus-core-npm-1.1.1-1e7281a98e-1e9c959984.zip/node_modules/@stimulus/core/dist/src'

Here is line 17

{% render_bundle 'example' %}

==== UPDATE ===

Ok there were a couple of errors, this is what i did to fix them

error 1

Can't resolve '@stimulus/multimap

SOLUTION:

yarn add @stimulus/multimap

error 2
Error: Can't resolve 'cable_ready'

SOLUTION:

yarn add cable_ready

error 3
render_bundle failing with TypeError: string indices must be integers

SOLUTION:

# app/webpack.py
from webpack_loader.loader import WebpackLoader

class CustomWebpackLoader(WebpackLoader):
    def filter_chunks(self, chunks):
        chunks = [chunk if isinstance(chunk, dict) else {'name': chunk} for chunk in chunks]
        return super().filter_chunks(chunks)

# settings.py
WEBPACK_LOADER = {
    ...
    'LOADER_CLASS': 'app.webpack.CustomWebpackLoader',
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant