Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

Module not found: Error: Can't resolve 'perf_hooks' #17

Closed
Teebo opened this issue Dec 3, 2021 · 1 comment
Closed

Module not found: Error: Can't resolve 'perf_hooks' #17

Teebo opened this issue Dec 3, 2021 · 1 comment
Assignees

Comments

@Teebo
Copy link

Teebo commented Dec 3, 2021

🐞 Bug report

Description

I am working on the issue of providing tokens in the server for universal pre-render.
I thought instead of providing the tokens in the server module, it makes sense to use the app module.
I have provided them like below.

import {
  UNIVERSAL_LOCATION,
  UNIVERSAL_USER_AGENT,
} from '@ng-web-apis/universal';

...

    {
      provide: UNIVERSAL_USER_AGENT,
      useValue: '',
    },
    {
      provide: UNIVERSAL_LOCATION,
      useValue: '',
    },

This seems to lead some where... to an error:

./node_modules/@ng-web-apis/universal/__ivy_ngcc__/fesm2015/ng-web-apis-universal.js:457:9-42 - Error: Module not found: Error: Can't resolve 'perf_hooks' in 'C:\Users\Thabo-Zyberfox\Development\sa-places-web\node_modules\@ng-web-apis\universal\__ivy_ngcc__\fesm2015'

Any ideas how to resolve this error?

Reproduction

http://www.stackblitz.com/...

Expected behavior

Versions

"@ng-web-apis/universal": "^1.12.0",
Angular 13

Additional context

Could be related to issue

Maybe check if it is the browser and provide the window performance?

@waterplea
Copy link
Member

You are not supposed to use server side tokens on client side modules, client side works as is because of factories for tokens and uses window.performance.

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

No branches or pull requests

2 participants