coolsam726/jetstream-inertia-generator

Could not resolve './Deselect'

clawes opened this issue · 4 comments

How can I resolve the following error?

*✓ 287 modules transformed.
Could not resolve './Deselect' from node_modules\vue-select\src\components\childComponents.js
error during build:
Error: Could not resolve './Deselect' from node_modules\vue-select\src\components\childComponents.js
at error (C:\laragon\www\fig\node_modules\rollup\dist\shared\rollup.js:158:30)
at ModuleLoader.handleResolveId (C:\laragon\www\fig\node_modules\rollup\dist\shared\rollup.js:22345:24)
at C:\laragon\www\fig\node_modules\rollup\dist\shared\rollup.js:22319:26
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This occurs when running yarn build

I managed to fix this myself.

The import statements in the childComponents.js file were referencing vue files.
I updated this file to include the vue file extension for the referenced files.

So I changed:

import Deselect from './Deselect'
to
import Deselect from './Deselect.vue'

This update corrected the issue.


C:\laragon\www\fig
λ ls -lh node_modules\vue-select\src\components
total 39K
-rw-r--r-- 1 clawes 1049089 649 Nov 30 21:15 Deselect.vue
-rw-r--r-- 1 clawes 1049089 431 Nov 30 21:15 OpenIndicator.vue
-rw-r--r-- 1 clawes 1049089 35K Nov 30 21:15 Select.vue
-rw-r--r-- 1 clawes 1049089 135 Dec 2 17:22 childComponents.js

C:\laragon\www\fig
λ cat node_modules\vue-select\src\components\childComponents.js
import Deselect from './Deselect.vue'
import OpenIndicator from './OpenIndicator.vue'

export default {
Deselect,
OpenIndicator,
}

Hi @clawes , sorry for the late response. If I am not wrong, the best way you should have solved this instead of changing the vue-select library would be to check how you are importing vue-select in the InfiniteSelect and JigSelect components.
If the components are importing from vue-select/src/..., change them to simply import from vue-select.
This is because previously we were using a temporal fork of vue-select that supports vue3 but we recently reverted back to the original vue-select package since they upgraded to support vue 3.

Summary:

  1. In both resources/js/JigComponents/InfiniteSelect and resources/js/JigComponents/JigSelect, Change the following import:
import vSelect from "vue-select/src/index";  //<--- Replace this
import vSelect from "vue-select";  //<--- With this
  1. In package.json, ensure you are using the latest vue-select ("vue-select": "^4.0.0-beta.1") and update the node modules.