question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Re-compilation failed on external import changes

See original GitHub issue

🐞 Bug report

Command (mark with an x)

  • serve

Is this a regression?

✍️ Yes, the previous version in which this bug was not present was: 11.0.5

Description

✍️ Since i up to 12.x.x version, i got error on re-compile application. In angular application I use external import out of project environment and folder.

import { CupertinoPane } from '../../../cupertino-pane';

I serve angular app with ng serve and there is no error on this moment. Then, i make changes in cupertino-pane package and build it again with

$ cd cupertino-pane
$ gulp build

In this time, angular cli successfully see changes and trying to re-compile app. Then i got error below. If i re-run ng serve error will disappear. What i want is real-time compilation to have ability make changes in external packages. I use this in previous versions.

ezgif-2-f08d32dd89d3

πŸ”₯ Exception or Error


Cannot find module '../../../cupertino-pane' or its corresponding type declarations.

🌍 Your Environment


Angular CLI: 12.2.4
Node: 14.17.4
Package Manager: npm 6.14.14
OS: darwin x64

Angular: 12.2.4
... cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1202.4
@angular-devkit/build-angular   12.2.4
@angular-devkit/core            12.2.4
@angular-devkit/schematics      12.2.4
@schematics/angular             12.2.4
rxjs                            6.6.7
typescript                      4.2.3

πŸ”¬ Minimal Reproduction

Prepare workspace

$ mkdir bug-workspace
$ cd bug-workspace
$ git clone https://github.com/roman-rr/cupertino-pane.git
$ ng new ng-project

You must have this folder structure:

- bug-workspace
   - cupertino-pane
   - ng-project

Code

Add import to angular project here /bug-workspace/ng-project/src/app/app.component.ts

import { CupertinoPane } from '../../../cupertino-pane';

Serve

$ cd /bug-workspace/ng-project/
$ ng serve

On this step you will have success compilation without errors with external package.

Catch error

Open new terminal tab and execute

$ cd /bug-workspace/cupertino-pane/
$ npm i
$ gulp build

Now look at first terminal where ng serve executed and you will have error. Re-execute ng serve and error will dissapears.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
roman-rrcommented, Oct 21, 2021

@alan-agius4 Disabled rollup-plugin-typescript2 cache for developing is enough at this moment. Probably it’s good to user Angular CLI or interesting stenciljs (which is build for many frameworks), hope to migrate in future.

Thanks!

1reaction
roman-rrcommented, Sep 9, 2021

@alan-agius4 updated main post with reproduction steps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compilation works but execution failed "SyntaxError: Cannot ...
Hello, What happened: Compilation good but not start. ... execution failed "SyntaxError: Cannot use import statement outside a module" #759.
Read more >
ERROR on compilation Cannot use import statement outside ...
I have check on the web, but I have seen many response: add type:module in package.json, change typescript options, ... but nothing seems...
Read more >
Solving the React Error: Not Picking Up CSS Style | Pluralsight
This error is generated because the compiler is only able to import files from the src folder. Here, the CSS file is saved...
Read more >
Compilation exception in Mule 4.x when using Groovy script ...
Mule 4 groovy component fails to compile when import statement is used and throws compilation exception during runtime.
Read more >
Gradle projects | IntelliJ IDEA Documentation - JetBrains
IntelliJ IDEA lets you manage Gradle projects. You can link, ignore projects, work with profiles, and synchronize changes in Gradle andΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found