inveniosoftware / invenio-assets

Invenio media assets management module.
https://invenio-assets.readthedocs.io
MIT License
1 stars 47 forks source link

less-loader: latest version breaks alias resolution #130

Open zzacharo opened 4 years ago

zzacharo commented 4 years ago

The latest version 6.1.2 breaks the assets build giving the error:

ERROR in ./node_modules/semantic-ui-less/semantic.less (./node_modules/css-loader??ref--8-1!./node_modules/less-loader/dist/cjs.js??ref--8-2!./node_modules/semantic-ui-less/semantic.less)
    Module build failed (from ./node_modules/less-loader/dist/cjs.js):

    @import (multiple) '../../theme.config';
    ^
    Less resolver error:
    '../../theme.config' wasn't found. Tried - /Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/node_modules/semantic-ui-less/theme.config,../../theme.config

    Webpack resolver error details:
    resolve '../../theme.config' in '/Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/node_modules/semantic-ui-less/definitions/modules'
      using description file: /Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/node_modules/semantic-ui-less/package.json (relative path: ./definitions/modules)
        aliased with mapping '../../theme.config': '/Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/less/theme.config' to '/Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/less/theme.config'
          using description file: /Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/node_modules/semantic-ui-less/package.json (relative path: ./definitions/modules)
            Field 'browser' doesn't contain a valid alias configuration
            using description file: /Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/package.json (relative path: ./less/theme.config)
              no extension
                Field 'browser' doesn't contain a valid alias configuration
                existing file: /Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/less/theme.config
                  /Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/less/theme.config doesn't match the restriction /\.(le|c)ss$/i
              .less
                Field 'browser' doesn't contain a valid alias configuration
                /Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/less/theme.config.less doesn't exist
              .css
                Field 'browser' doesn't contain a valid alias configuration
                /Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/less/theme.config.css doesn't exist
              as directory
                /Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/less/theme.config is not a directory

    Webpack resolver error missing:
    /Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/less/theme.config.less,/Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/less/theme.config.css,/Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/less/theme.config

          Error in /Users/zzacharo/.virtualenvs/webpack-test-oPSfLRWq/var/instance/assets/node_modules/semantic-ui-less/definitions/modules/transition.less (line 19, column 0)

Hints

In the latest release, they changed the resolution logic and this might be the cause. Needs more investigation.

General thoughts

ppanero commented 4 years ago

https://github.com/webpack-contrib/less-loader/issues/366

BalazsBago commented 3 years ago

Hi, Do You have a workaround for this issue? I still encounter it with the current version of invenio-rdm (https://github.com/inveniosoftware/invenio-app-rdm/releases/tag/v0.18.8).

zzacharo commented 3 years ago

@BalazsBago which version of less-loader do you have locally installed? Maybe for more help, you could use the InvenioRDM discord channel :)

BalazsBago commented 3 years ago

@zzacharo I have tried 6.2.0 (this is expected version based on the packages.json in invenio-assests#1.2.5), 6.1.0 and 7.2.1, but all of them produced the same error. Thanks for the tip, I am going to join the discord channel of InvenioRDM.