Skip to content

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

@tawanda

Description

@tawanda

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',
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions