-
Notifications
You must be signed in to change notification settings - Fork 51
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
Module fails to resolve relative path @3.5.2 #86
Comments
I'm not sure, I've been using it in my project with dozens of direct dependencies (and ~hundreds of indirect) and it worked fine. Also confirmed from other devs. @vortrefflich can you provide more info please? Is there an external dependency that's related to this? Can you please provide a sandbox/repo that reproduces this issue? |
I also have a fairly complex Frontend and Backend webpack build and it's the #85 in version 3.5.2 which makes it compile. Once we know more details I can comment more. |
Same here but even with [email protected] it doesnt work! And it was working days ago :( I dont know which package I've update ts-loader: 9.2.6 tsconfig.json {
"compilerOptions": {
"outDir": "dist",
"baseUrl": ".",
"target": "es2020",
"lib": ["es2020"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"module": "commonjs",
"allowSyntheticDefaultImports": false,
"moduleResolution": "node",
"resolveJsonModule": true,
"esModuleInterop": true,
"isolatedModules": true,
"types": ["node"],
"paths": {
"@mocks/*": ["../../__mocks__/*"],
"@app/*": ["./src/*"]
},
"incremental": true
},
"exclude": ["../../node_modules"],
"include": ["src"]
} webpack.config.js
I'm using it in a yarn workspaces project |
@voliva Sorry, now I noticed you requested more detail before. My code is nothing special. I just followed example codes which are from googling. Now I use your module with 'path' module to convert relative path to absolute path. with combination of '__dirname', I just guess this problem is derived from different paths among webpack config file, index.ts (base ts) file, and package.json. src
|
I also encountered this problem. In my scenario, if I import a file with absolute import which internally imports another file with relative import, it doesn't work. It is not giving me any build error but I have enum defined in file relatively imported and that enum becomes undefined. Here is my directory structure.
It seem to have been fixed by downgrading to 3.5.1 |
You can work around this by using absolute path:
|
Hello team,
I have been used your module @3.5.1.
Recently, I noticed there were errors while resolving relative paths in webpack for recently updated modules.
I tested other modules but only with your latest module (3.5.2), the errors were occurred.
Environment=================
ts-loader: ^9.2.3
typescript: ^4.3.2
webpack: ^5.64.2
Result=====================
=========================
Error=======================
Module not found: Error: Can't resolve './RELATIVE_DIR/index.ts' in 'ABSOLUTE_MY_REPO_PATH'
...Field 'browser' doesn't contain a valid alias configuration ...
============================
I hove this report help you and other developers.
The text was updated successfully, but these errors were encountered: