question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webpack alias resolvers via configureWebpack and chainWebpack in gridsome config don't work

See original GitHub issue

Steps to reproduce

  1. Create a new gridsome project
  2. Import path and add the lines below to the gridsome.config.js file
  configureWebpack: {
    resolve: {
      alias: {
        '@saucedrip': path.resolve('../literal-sauce-drip/'),
      }
    }
  }
  1. Start the project with gridsome develop

Expected result

The aliases should be recognised and everything should work fine.

Actual result

Gridsome yells errors saying “These dependencies were not found… To install them, you can run: npm install…”.

NOTE: I get the same result when I try to use chainWebpack to merge the config objects or assign properties to the config.resolve.alias object directly.

Environment


Libs:
- gridsome version: 0.7.3
- @gridsome/cli version: 0.2.1

 
For Tooling issues:
- Node version: 11.12.0
- Platform:  Mac

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hjvedvikcommented, Sep 30, 2019

Great! The configureWebpack option was added in v0.6 so that is probably why it didn’t work 😃

0reactions
whizkydeecommented, Sep 30, 2019

Closing this as it now works in gridsome@0.7.6. It still doesn’t work in 0.5.0. Maybe it wasn’t supported then? Also, I just noticed that I included the version of the globally installed gridsome instead of the local one in the initial issue description (my bad).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Project configuration - Gridsome
Gridsome requires gridsome.config.js to work. Plugins and project settings are located here. A basic configuration file would look something like this:
Read more >
Webpack resolve.alias does not work with typescript?
This solved my problem: we were using a custom module syntax which defined aliases to files other than index . Renaming the files...
Read more >
Webpack aliases defined in vue.config.js are not recognized
What steps will reproduce the issue? Configure Vue CLI project with aliases ( @ for source root for exmple); Open a file that...
Read more >
gridsome @ 0.5.8 .. 0.6.0 - Package Diff
+ return reject(new Error(`Could not resolve ${url}.`)) ... +* **webpack:** configure webpack ... + this.events.on('chainWebpack', { handler: this.config.
Read more >
How to configure Vue CLI 3 to leverage webpack root folder ...
With previous Vue CLI I was able to use aliases to keeps my assets in one folder, and linking to the assets wth...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found