tsslint icon indicating copy to clipboard operation
tsslint copied to clipboard

[Bug] Error ERR_UNSUPPORTED_ESM_URL_SCHEME

Open joris-fonck-loreal opened this issue 1 year ago • 2 comments

Description

First of all, thank you for your amazing work for this tool, volar and other projects!

I'm trying to use tsslint on Windows and I got the following error when using the CLI:

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file and data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'.

The error appear in watch.ts file line 23. The given imported file at line 21 is not using file:// protocol. But when I tried to put file protocol at the beginning of the path, I still have the same issue. So maybe it's because of the created hashed file in node_modules/.tsslint/<hash>.mjs. There are using c:// protocol to import files but I don't know how this file is generated so I didn't tested it.

joris-fonck-loreal avatar Sep 20 '24 09:09 joris-fonck-loreal

node_modules/.tsslint/<hash>.mjs will be rebuilt every time you execute tsslint command. When you added file:// and execute tsslint command again, node_modules/.tsslint/<hash>.mjs should be updated.

I'll try to test this issue on windows, and it would be helpful if you could provide a reproduction.

johnsoncodehk avatar Sep 21 '24 11:09 johnsoncodehk

Of course. Here is a repro: https://github.com/joris-fonck-loreal/tsslint-vscode-ext-repro

joris-fonck-loreal avatar Sep 21 '24 17:09 joris-fonck-loreal

Sorry for the delay, the problem should have been fixed in v1.0.20 by https://github.com/johnsoncodehk/tsslint/pull/23!

johnsoncodehk avatar Oct 29 '24 08:10 johnsoncodehk