Skip to content

invenio webpack clean buildall fails with Module not found: Error: Can't resolve '@templates' #147

@ZedThree

Description

@ZedThree

Package version (if known): 1.3.0

Describe the bug

Running invenio webpack clean buildall fails because the templates directory is missing from the instance path

Steps to Reproduce

  1. cookiecutter gh:inveniosoftware/cookiecutter-invenio-instance -c v3.4 --no-input
  2. Install the following set of packages:
    invenio[auth, metadata, files, postgresql, elasticsearch7 ] >= 3.5.0a4
    invenio-admin >= 1.3.2,<1.4.0
    invenio-assets >= 1.3.0,<1.4.0
    invenio-formatter >= 1.1.3,<1.2.0
    invenio-logging >= 1.3.0,<1.4.0
    invenio-mail >= 1.0.2,<1.1.0
    invenio-rest >= 1.2.8,<1.3.0
    invenio-theme >= 1.3.17,<1.4.0
    lxml >=4.3.0,<5.0.0
    marshmallow >=3.0.0,<4.0.0
    uwsgi >=2.0
    uwsgi-tools >=1.1.1
    uwsgitop >=0.11

(Note that these are slightly different from those in the default Pipfile, notably invenio >= 3.5.0a4 and invenio-assets >= 1.3.0. We need to specify a whole bunch of other invenio-* packages because specifying invenio-assets manually clashes with invenio[base])
3. Run invenio webpack clean buildall
4. Get the following error:

ERROR in ./js/invenio_theme/templates.js
Module not found: Error: Can't resolve '@templates' in '/venv/var/instance/assets/js/invenio_theme'
 @ ./js/invenio_theme/templates.js 26:19-28:47
 @ ./js/invenio_search_ui/util.js
 @ ./js/invenio_search_ui/app.js

I managed to manually fix this by running mkdir /venv/var/instance/assets/templates, but it was pointed out in the Discord that invenio-cli symlinks this directory (although I couldn't work out what the target should be). However, if you're using Invenio Framework, then that tool won't work.

Could the webpack command itself instead take care of ensuring the directory exists?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions