Failed to Compile w/ Absolute Import Paths v1.2.0
See original GitHub issueHi,
I followed the quick start and terminal commands instructions from the Readme and am getting a failed to compile error due modules being unable to resolve. When I change the import statements to use relative paths the modules do resolve:
For example, with absolute path:
import "assets/css/material-dashboard-react.css?v=1.2.0"; // Compile Error
Changing to relative path:
import "./assets/css/material-dashboard-react.css?v=1.2.0"; // Module is resolved properly
I saw the .env
file does specify the NODE_PATH
environment variable, but cannot get absolute paths to work on import statements;
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Cannot get the absolute paths working in typescript nodejs ...
The VSCode intellisense is able to resolve the absolute import paths fine, but when I compile, I get compilation error. Note: relative paths...
Read more >Import-Module (Microsoft.PowerShell.Core)
The Import-Module cmdlet adds one or more modules to the current session. ... Starting in Windows PowerShell 3.0, you can use Import-Module to...
Read more >Module Resolution - webpack
A resolver is a library which helps in locating a module by its absolute path. A module can be required as a dependency...
Read more >tsc-alias - npm
Replace alias paths with relative paths after typescript compilation. ... tsconfig.json project by providing a relative path to the baseUrl.
Read more >Documentation - Module Resolution - TypeScript
ts. For non-relative module imports, however, the compiler walks up the directory tree starting with the directory containing the importing file, trying to ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello @marciandmnd ,
You can solve this issue by changing the start script from:
to
and also you will need to install cross-env globally on your machine
Best, Manu
A better solution is to create a jsconfig.json file with this code inside it:
All of our React products will have this file in the next updates.
Best, Manu ReactJS Developer