Commit 7ca8b05
authored
fix(templates): remove tilde SCSS imports and add Sass loadPaths for Windows (#16295)
## Summary
- Removes deprecated tilde (`~`) prefix from `@import` statements in all
template SCSS files (`website`, `with-vercel-website`, `ecommerce`). The
tilde syntax relies on legacy Webpack resolution behavior and is not
supported by Turbopack, which is the default bundler in Next.js 16.
- Adds `sassOptions.loadPaths` pointing to `@payloadcms/ui/dist/scss/`
in each template's `next.config.ts`. This is a workaround for a
Turbopack bug on Windows where Sass fails to resolve sibling imports
(e.g. `@import 'vars'`) due to missing `includePaths` and backslash path
issues (vercel/next.js#86431).
- Expands the `lint:scss` script glob to also cover
`templates/**/*.scss`, so the existing `no-tilde-imports` stylelint rule
(added in #15028) catches template files going forward.
Fixes #16059
## Disclaimer
This bug only reproduces on Windows. We are a Mac-only team and have not
been able to reproduce it locally, but the fix aligns with the confirmed
community workaround and is consistent with the changes already applied
to `packages/ui` in #15028. If the next release still does not resolve
the issue for Windows users, I am happy to quickly explore a follow-up
PR.
## Test plan
- [x] Verify `pnpm run lint:scss` passes (no tilde imports detected)
- [ ] Windows users: run `npx create-payload-app@latest -t website` and
confirm `npm run dev` no longer throws `Can't find stylesheet to import`
- [x] Verify templates still compile correctly on macOS/Linux (no
regressions from `loadPaths` addition)
Co-authored-by: German Jablonski <GermanJablo@users.noreply.github.com>1 parent 474eda2 commit 7ca8b05
9 files changed
Lines changed: 21 additions & 6 deletions
File tree
- templates
- ecommerce
- src/components/BeforeDashboard
- website
- src/components
- AdminBar
- BeforeDashboard
- with-vercel-website
- src/components
- AdminBar
- BeforeDashboard
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
13 | 18 | | |
14 | 19 | | |
15 | 20 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
0 commit comments