ng-universal icon indicating copy to clipboard operation
ng-universal copied to clipboard

TS2307: Cannot find module '@nestjs/ng-universal/tokens' or its corresponding type declarations.

Open DaSchTour opened this issue 4 years ago • 8 comments

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

DaSchTour avatar May 06 '21 11:05 DaSchTour

BTW using @nestjs/ng-universal/dist/tokens works but throws a CommonJS or AMD dependencies can cause optimization bailouts. warning

DaSchTour avatar May 07 '21 10:05 DaSchTour

Same issue as well

macure avatar May 12 '21 00:05 macure

Seeing the same issue as well.

quinnjr avatar Jul 27 '21 21:07 quinnjr

Same issue as well

tincho-despegar avatar Oct 25 '21 19:10 tincho-despegar

I am wondering why after almost a year this issue is still open without any fix! Shouldn't we use Nestjs for SSR?

Salarov avatar Jan 31 '22 12:01 Salarov

And it's only merging the linked PR. Maybe we need to mention some of the maintainers to raise attention?

DaSchTour avatar Jan 31 '22 16:01 DaSchTour

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.

DaSchTour avatar Sep 16 '22 12:09 DaSchTour

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.

DaSchTour avatar Feb 09 '23 15:02 DaSchTour