Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: vite+vue-router alias work error #1645

Closed
hunshcn opened this issue Apr 13, 2024 · 1 comment
Closed

[Bug]: vite+vue-router alias work error #1645

hunshcn opened this issue Apr 13, 2024 · 1 comment
Labels
bug Something isn't working untriaged Requires traige

Comments

@hunshcn
Copy link
Contributor

hunshcn commented Apr 13, 2024

What happened?

I make a repo to reproduce. https://github.com/hunshcn/vitets_alias_broken

It use vite + vue + vue-router.
In main.ts when I use @/ alias instead of ./, the build artifact will be broken.

It looks like related to vue-router. If I delete all router usage, errors will be disappear.

The above problems only appear when compiling with rules_js. pnpm build or use vite_binary and chdir to "$$BUILD_WORKSPACE_DIRECTORY/" + package_name() to use local node_modules, and there is no problem.

Version

Development (host) and target OS/architectures:

Output of bazel --version: 7.1.1

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file: 1.41.0

Language(s) and/or frameworks involved: js

How to reproduce

https://github.com/hunshcn/vitets_alias_broken

Any other information?

No response

@hunshcn hunshcn added the bug Something isn't working label Apr 13, 2024
@github-actions github-actions bot added the untriaged Requires traige label Apr 13, 2024
@hunshcn
Copy link
Contributor Author

hunshcn commented Apr 20, 2024

Fixed

the reason of the problem is the usage of fileURLToPath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged Requires traige
Projects
None yet
Development

No branches or pull requests

1 participant