TS2307: Cannot find module '@nestjs/ng-universal/tokens' or its corresponding type declarations.
I'm submitting a...
[ ] Regression
[X] Bug report
[ ] Feature request
[X] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
TS2307: Cannot find module '@nestjs/ng-universal/tokens' or its corresponding type declarations.
Expected behavior
No TS error
Minimal reproduction of the problem with instructions
import { REQUEST } from '@nestjs/ng-universal/tokens';
Environment
Nest version: 4.3.0
For Tooling issues:
- Node version: 14.16.0
- Platform: Mac
Others:
WebStorm, NPM and NX
BTW using @nestjs/ng-universal/dist/tokens works but throws a CommonJS or AMD dependencies can cause optimization bailouts. warning
Same issue as well
Seeing the same issue as well.
Same issue as well
I am wondering why after almost a year this issue is still open without any fix! Shouldn't we use Nestjs for SSR?
And it's only merging the linked PR. Maybe we need to mention some of the maintainers to raise attention?
As a workaround I just published a package with this fix. You can drop it into the current installation without changing imports by adding "@nestjs/ng-universal": "npm:@nestjs-fixed/[email protected]", to your package.json.
While this issue is still not fixed in 7.0.0 and this package does not work as described in the README I published a new version with an adjusted token export. Use "@nestjs/ng-universal": "npm:@nestjs-fixed/[email protected]", to be able to import tokens as described in the README.