Duplicates
Latest version
Current behavior 😯
If you use the Typescript import alias ~ from within a package it resolves incorrectly throwing an error.
For context I am also using the vite-tsconfig-paths plugin which correctly handles this situation on a regular Vite app.
You can reproduce the behaviour by running this Solid Start app.
You will seeing the following error in the browser:
[plugin:vite:import-analysis] Failed to resolve import "~/demo" from "lib/src/index.ts". Does the file exist?
/Users/oscar/Desktop/solid-project/lib/src/index.ts:2:7
import "~/demo";
Expected behavior 🤔
No response
Steps to reproduce 🕹
Repository or Stackblitz
Context 🔦
I am fairly sure the fact that Solid Start defines a resolver for ~ which points to the app root is causing the code within the subpackages to try and resolve the alias relative to the root of the app and not the current package.
This can kinda be confirmed by enabling this pnpm patch which removes that resolver and noticing that the error goes away.
Your environment 🌎
No response
Duplicates
Latest version
Current behavior 😯
If you use the Typescript import alias
~from within a package it resolves incorrectly throwing an error.For context I am also using the vite-tsconfig-paths plugin which correctly handles this situation on a regular Vite app.
You can reproduce the behaviour by running this Solid Start app.
You will seeing the following error in the browser:
Expected behavior 🤔
No response
Steps to reproduce 🕹
Repository or Stackblitz
pnpm ipnpm devContext 🔦
I am fairly sure the fact that Solid Start defines a resolver for
~which points to the app root is causing the code within the subpackages to try and resolve the alias relative to the root of the app and not the current package.This can kinda be confirmed by enabling this pnpm patch which removes that resolver and noticing that the error goes away.
Your environment 🌎
No response