-
-
Notifications
You must be signed in to change notification settings - Fork 253
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
Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'd:' #3405
Comments
@Darkjamin @prakhargupta1 I have opened a PR with a potential fix. Would you mind trying it out by installing |
The fix works for me. |
Same here, I can confirm it is working now for me. |
Thanks for trying, this will be fixed in the next release |
Steps to reproduce
Created a new function.ts to make connection to MySQL.
Code:
mport mysql from 'mysql2/promise';
async function createConnection() {
const connection = await mysql.createConnection({
host: process.env.MYSQL_HOST,
port: parseInt(process.env.MYSQL_PORT || '3306'),
user: process.env.MYSQL_USERNAME,
password: process.env.MYSQL_PASSWORD,
database: process.env.MYSQL_DATABASE,
namedPlaceholders: true,
});
return connection;
}
export async function getData() {
const connection = await createConnection();
const query =
SELECT * players
;const [rows] = await connection.execute(query);
await connection.end();
return rows;
}
.env is available and filled in.
Current behavior
When getting into Queries + =+> Js query, select the config, then open, then "getData".
Then doing Run:
Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'd:'
Expected behavior
Query runs and gives responce
Context
Connecto to external MySQL DB
Your environment
System:
OS: Windows 11 10.0.22631
Binaries:
Node: 18.17.1 - C:\Program Files\nodejs\node.EXE
npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD
pnpm: Not Found
Browsers:
Chrome: Not Found
Edge: Chromium (123.0.2420.97)
npmPackages:
@emotion/react: 11.11.4
@emotion/styled: 11.11.5
@mui/base: 5.0.0-beta.40
@mui/core-downloads-tracker: 5.15.15
@mui/icons-material: 5.15.15
@mui/lab: 5.0.0-alpha.170
@mui/material: 5.15.15
@mui/private-theming: 5.15.14
@mui/styled-engine: 5.15.14
@mui/system: 5.15.15
@mui/types: 7.2.14
@mui/utils: 5.15.14
@mui/x-charts: 7.1.1
@mui/x-data-grid: 7.1.1
@mui/x-data-grid-premium: 7.1.1
@mui/x-data-grid-pro: 7.1.1
@mui/x-date-pickers: 7.1.1
@mui/x-date-pickers-pro: 7.1.1
@mui/x-license: 7.1.1
@mui/x-tree-view: 7.1.1
@types/react: 18.2.78
react: 18.2.0
react-dom: 18.2.0
typescript: 5.4.4
Search keywords: Windows ESM Loader
The text was updated successfully, but these errors were encountered: