Giter Site home page Giter Site logo

Comments (6)

 avatar commented on June 6, 2024 2

I'm reproducing this error too. Angular 6 will be out soon.

I fixed it by adding declare var module: {}; above the module line in main.ts

However, it reloads the window on scss inline-template style.

from angular-hmr.

enten avatar enten commented on June 6, 2024 2

About error TS2304: Cannot find name 'module': do you think may it due to a missing typescript definition?

Can you try to npm install --save-dev @types/node@~8.9.4 @types/webpack-env@^1.13.6 and add the directive below in your src/typings.d.ts?

///<reference types="webpack-env" />

from angular-hmr.

maroy1986 avatar maroy1986 commented on June 6, 2024 1

This is also tracked here in the CLI issues :
angular/angular-cli#10268

from angular-hmr.

rafa-suagu avatar rafa-suagu commented on June 6, 2024 1

@maroy1986 is very strange but I have two equal projects (same config files, same versions, same node, same yarn, etc...) and one works properly and the other throws the error.

I found here https://github.com/angular/angular-cli/wiki/stories-configure-hmr one thing that solves the problem but I only need in one of the two projects.

Add the necessary types to src/tsconfig.app.json
{ ... "compilerOptions": { ... "types": ["node"] }, }

from angular-hmr.

TheAifam5 avatar TheAifam5 commented on June 6, 2024

@enten that works. Thank you :)

from angular-hmr.

maroy1986 avatar maroy1986 commented on June 6, 2024

Somehow, this started working again, weird but I'm gonna close this issue and pretend it was something on my end.

from angular-hmr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.