Broken build process on Windows
Closed this issue · 0 comments
thomasdondorf commented
- Component or Package Name: jsx-email
- Component or Package Version: 1.12.0
- Operating System (or Browser): Windows 10
- Node Version: 20.12.1
- Reproduction:
Windows OS:
npm create jsx-email
npm run build # which will run: email build ./templates
Expected Behavior
The templates are built.
Actual Behavior
The following error:
> test-email-project@0.0.0 build
> email build ./templates
Found 1 files:
templates/email.tsx
Starting build...
Error: ENOENT: no such file or directory, mkdir 'D:\test-email-project\.rendered\C:\Users\Thomas\AppData\Local\Temp\jsx-email\1715164138117'
Additional Information
I investigated the problem and the problem is in this line:
The call path.replace(outputBasePath, '')
uses the following variables with the content:
path
:C:/Users/Thomas/AppData/Local/Temp/jsx-email/1715164607648/Welcome.js
outputBasePath
:C:\Users\Thomas\AppData\Local\Temp\jsx-email\1715164607648
So it looks like outputBasePath
was run through path.resolve
somewhere (turning /
into \
on Windows) while path
was not. Therefore, path.replace(outputBasePath, "")
does nothing as the separators are different...
A fix would be to run the variable path
through resolve
to fix the separators.