Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

What is the correct way of using Zone.js in Node #411

Closed
saskodh opened this issue Aug 21, 2016 · 3 comments
Closed

What is the correct way of using Zone.js in Node #411

saskodh opened this issue Aug 21, 2016 · 3 comments

Comments

@saskodh
Copy link

saskodh commented Aug 21, 2016

I want to use Zone.js on the back-end to create something like ThreadLocal-storage similar to the traditional web-servers. The idea is to run the request handling in a new Zone. This will be part of a new back-end framework on which I recently started working.

At the moment I am using it like this, imported before everything else:

import 'zone.js';
import "zone.js/dist/long-stack-trace-zone.js";

So far it works fine but importing it like this fails the TypeScript compilation with the following error:

Error TS2656: Exported external package typings file '../node_modules/zone.js/dist/zone.js.d.ts' is not a module. Please contact the package author to update the package definition.

This was reported here but so far was not resolved even though the issue was closed.

For now I did a temporary workaround by replacing the default typings that come with the package with typings from DefinitelyTyped which btw are not complete. I did this with postinstall script in order to make it working.

I am using the latest release: v0.6.15

@PatrickJS
Copy link
Contributor

if you try again with 0.6.27 and latest version of typescript 2.x.x you should be good

@johnbendi
Copy link

@gdi2290 I'm still getting this error or similar even with the latest 0.7.4

@JiaLiPassion
Copy link
Collaborator

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

4 participants