You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Navigate to http://localhost:4200 and http://localhost:4200/wontwork. On the first page, a vanilla extract component will be imported from the Next app itself. On the second page, identical code will instead be imported from a @nrwl/react library package. The following error will be displayed
../design/src/components/card/Card.css.ts
ModuleParseError: Module parse failed: Unexpected token (5:5)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import clsx from 'clsx';
|
> type Sprinkles = Parameters<typeof sprinkles>[0];
| interface Atoms extends Sprinkles {
| className?: string | string[];
It seems when importing from a package, the loader doesn't recognise Typescript.
../design/src/components/card/Card.css.ts
ModuleParseError: Module parse failed: Unexpected token (5:5)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import clsx from 'clsx';|>type Sprinkles = Parameters<typeof sprinkles>[0];| interface Atoms extends Sprinkles {
| className?: string | string[];
Additional Information
patch-package is used to patch [email protected] so that it will start under v15.9.2.
Same error occurs under 16.0.0-beta8.
The text was updated successfully, but these errors were encountered:
Upon more investigation, it is not an Nx issue, but seems to be related to vanilla-extract and using source outside of the Next.js project root. I put together this example without Nx that shows the exact same problem.
Current Behavior
See repro repo here: https://github.com/westmark/next-vanilla-extract-ts-bug
> nx serve main
Navigate to http://localhost:4200 and http://localhost:4200/wontwork. On the first page, a vanilla extract component will be imported from the Next app itself. On the second page, identical code will instead be imported from a
@nrwl/react
library package. The following error will be displayedIt seems when importing from a package, the loader doesn't recognise Typescript.
Possibly related: #16516
Expected Behavior
It should be possible to import from separate libraries.
GitHub Repo
https://github.com/westmark/next-vanilla-extract-ts-bug
Steps to Reproduce
yarn
> nx serve main
Nx Report
Failure Logs
Additional Information
patch-package
is used to patch[email protected]
so that it will start underv15.9.2
.16.0.0-beta8
.The text was updated successfully, but these errors were encountered: