Skip to content
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

Broken build process on Windows #194

Closed
thomasdondorf opened this issue May 8, 2024 · 0 comments · Fixed by #195
Closed

Broken build process on Windows #194

thomasdondorf opened this issue May 8, 2024 · 0 comments · Fixed by #195

Comments

@thomasdondorf
Copy link
Contributor

  • 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:

? join(out!, path.replace(outputBasePath, '').replace(extname(path), extension))

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant