Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: The glob pattern import("./**/*.entry.js*") did not match any files [empty-glob]bug: #5427

Open
3 tasks done
benjaminmilcic opened this issue Mar 3, 2024 · 25 comments
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil

Comments

@benjaminmilcic
Copy link

Prerequisites

Stencil Version

dont know

Current Behavior

-1

In my Angular Project, when i do ng build, the build is canceled and i got:

▲ [WARNING] The glob pattern import("./**/.entry.js") did not match any files [empty-glob]

node_modules/@stencil/core/internal/client/index.js:3808:2:
  3808 │   `./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVers...
       ╵   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ng serve works well.

Has anyone an idea what that means?

Expected Behavior

i expect that the build do not cancel.

System Info

"npx stencil info" gives me:

 Build: 1708962986
     Stencil: 4.12.4
  TypeScript: 5.3.3
      Rollup: 2.56.3
      Parse5: 7.1.2
      jQuery: 4.0.0-pre
      Terser: 5.27.2

Steps to Reproduce

i do not know

Code Reproduction URL

i do not know

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Mar 3, 2024
@christian-bromann
Copy link
Member

@benjaminmilcic thanks for raising the issue.

It would be great if you could provide a bit more information to help us reproduce the case. Is your project using Stencil components from an NPM module or are you using Stencil components directly. This error message alone won't help us to start any investigations.

@christian-bromann christian-bromann added ionitron: needs reproduction This PR or Issue does not have a reproduction case URL and removed triage labels Mar 3, 2024
Copy link

ionitron-bot bot commented Mar 3, 2024

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

Please reproduce this issue in an Stencil starter component library and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

For a guide on how to create a good reproduction, see our Contributing Guide.

@benjaminmilcic
Copy link
Author

I don`t use Stencil directly. I never worked with it directly. I think it is used by Ionic.

Here is my package.json

{ "name": "aznw-routes", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "watch": "ng build --watch --configuration development", "test": "ng test" }, "private": true, "dependencies": { "@angular/animations": "^17.1.0", "@angular/cdk": "^17.2.1", "@angular/common": "^17.1.0", "@angular/compiler": "^17.1.0", "@angular/core": "^17.1.0", "@angular/forms": "^17.1.0", "@angular/google-maps": "^17.2.1", "@angular/material": "^17.2.1", "@angular/platform-browser": "^17.1.0", "@angular/platform-browser-dynamic": "^17.1.0", "@angular/router": "^17.1.0", "@ionic/angular": "^7.7.3", "@ngx-translate/core": "^15.0.0", "@ngx-translate/http-loader": "^8.0.0", "@tinymce/tinymce-angular": "^7.0.0", "angular-resizable-element": "^7.0.2", "feiertagejs": "^1.4.0", "ng2-tooltip-directive": "^2.10.3", "ngx-toastr": "^18.0.0", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.14.3" }, "devDependencies": { "@angular-devkit/build-angular": "^17.1.2", "@angular/cli": "^17.1.2", "@angular/compiler-cli": "^17.1.0", "@types/jasmine": "~5.1.0", "jasmine-core": "~5.1.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.2.0", "karma-coverage": "~2.2.0", "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.1.0", "tailwindcss": "^3.4.1", "typescript": "~5.3.2" } }

ng build worked before. Then I changed it to use angular routes and I added angular material and ionic.
I remember that I also installated the pagage " postcss-import" and removed it again.
ng serve worked well all the time. Then i made ng build and it breaks.

Here is my tsconfig.js

/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "compileOnSave": false, "compilerOptions": { "outDir": "./dist/out-tsc", "forceConsistentCasingInFileNames": true, "strict": false, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "skipLibCheck": true, "esModuleInterop": true, "sourceMap": true, "declaration": false, "experimentalDecorators": true, "moduleResolution": "node", "importHelpers": true, "target": "ES2022", "module": "ES2022", "useDefineForClassFields": false, "lib": [ "ES2022", "dom" ] }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, "strictInjectionParameters": true, "strictInputAccessModifiers": true, "strictTemplates": false } }

Shall I provide other files here, like package-lock.json or so?

@alicewriteswrongs
Copy link
Member

Hello @benjaminmilcic, this looks like it might be the same issue as #5389 which was fixed in Stencil v4.12.4. Ionic Framework, however, is currently using Stencil v4.12.3, so I think that may have to do with why you're seeing the error.

To help us confirm that, could you provide a minimal reproduction case which showcases the issue? We aren't able to do much to help diagnose the issue without one. A minimal reproduction would be a git repository which includes the simplest project which showcases the problem, and will let us diagnose the issue and then test out a fix.

@benjaminmilcic
Copy link
Author

benjaminmilcic commented Mar 4, 2024

Ok, here are steps to reproduce:

  1. ng new
    (name: test)
    (style sheets: css)
    (no SSR)
  2. ng add @ionic/angular
  3. ng build

ng version gives me:

Angular CLI: 17.2.2
Node: 20.11.0
Package Manager: npm 10.2.4
OS: win32 x64

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

Package Version

@angular-devkit/architect 0.1702.2
@angular-devkit/build-angular 17.2.2
@angular-devkit/core 17.2.2
@angular-devkit/schematics 17.2.2
@angular/cli 17.2.2
@schematics/angular 17.2.2
rxjs 7.8.1
typescript 5.3.3
zone.js 0.14.4

ionic version gives me:
7.2.0

And here is a GitHub-Repo:
[(https://github.com/benjaminmilcic/ionic-stencil-error)]

Thanks a lot for the time to try helping...

@christian-bromann christian-bromann added Bug: Validated This PR or Issue is verified to be a bug within Stencil and removed ionitron: needs reproduction This PR or Issue does not have a reproduction case URL labels Mar 4, 2024
@christian-bromann
Copy link
Member

I was able to clone the reproduction and saw the following warning in the build step:

▲ [WARNING] The glob pattern import("./**/*.entry.js*") did not match any files [empty-glob]

    node_modules/@stencil/core/internal/client/index.js:3808:2:
      3808 │   `./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVers...
           ╵   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I think this warning can be ignored however we should identify if @ionic/angular uses Stencils lazy components or DCE (dist-custom-elements) and if not, ensure this part of stencil is not imported anywhere.

@benjaminmilcic we have ingested the issue into our backlog and will at it eventually. I unfortunately can't give you a timeline at this point but will make sure to post updates as we have it.

@benjaminmilcic
Copy link
Author

Can I ask you how I can make ng build with ignoring the warning and not break the build?

@papastepano
Copy link

papastepano commented Mar 23, 2024

Thanks for rasing this issue. Experiencing the same problem, too.

@moh4sa
Copy link

moh4sa commented Apr 1, 2024

experiencing the same problem, too.

@VerburgtJimmy
Copy link

Is there a temporary fix coming for this issue or even better a permanent fix. It's a bit weird to build a app for production with these kinds of warnings in them even though they are harmless. Thanks!

@rwaskiewicz
Copy link
Member

Hey folks, we don't have a timeline at the moment. Please upvote this issue using the 👍 reaction on the summary of the issue to help us get better visibility into its severity

@WhippyM
Copy link

WhippyM commented Apr 4, 2024

experiencing the same problem with node 18, too.

@JavierValdez
Copy link

Tengo exactamente el mismo problema tambien

@gultyayev
Copy link

I could not reproduce the "build cancelled". I have one project of my own running latest Ionic & Angular. I have cloned the repro. In both cases I have the build output. I do get the warning, but usually, they can be disregarded. The build is still generated.
image
image

Perhaps, it has something to do with the Node version. Usually, if I have build problems it's because the Node version is incompatible with Angular somehow.

image

@claudiotrenca
Copy link

i'm experiencing this problem too

Angular CLI: 17.3.0
Node: 20.11.1
Package Manager: npm 10.2.4
OS: win32 x64

Angular: 17.3.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, platform-browser, platform-browser-dynamic
... router

Package Version

@angular-devkit/architect 0.1703.0
@angular-devkit/build-angular 17.3.0
@angular-devkit/core 17.3.0
@angular-devkit/schematics 17.3.0
@schematics/angular 17.3.0
rxjs 7.8.1
typescript 5.4.2
zone.js 0.14.4

@christian-bromann
Copy link
Member

@WhippyM @claudiotrenca can you elaborate what problem you are experiencing? I can confirm what @gultyayev is observing which is that a warning is being thrown but can be disregarded.

@HaidarVladyslav
Copy link

I also face this issue. I don't have any private info, so I can share it.
I can't ionic build, ionic cap sync ios.

@christian-bromann here is repo https://github.com/HaidarVladyslav/ionic-report-glob-import

Please let me know if it's internal issue or just on my side - but according to current discussion it seems few people also face same issue. Hope it helps, thank you!

@WhippyM
Copy link

WhippyM commented Apr 15, 2024

@WhippyM @claudiotrenca can you elaborate what problem you are experiencing? I can confirm what @gultyayev is observing which is that a warning is being thrown but can be disregarded.

It seems like it was another mistake. It is only a warning. But it's confusing.

@gultyayev
Copy link

@HaidarVladyslav it's not clear from your post what error you are facing, as the "error" in the topic is not an error, but a warning, and does not prevent builds, normally.

What issues I see when I cloned your repo:

  1. There is no CLI installed in the project. The error clearly complains about that. Which I have fixed for my local install.

  2. The build passes successfully, but cap sync phase fails. And again, it has a clear error message
    image

    It's fixed easily by changing the folder in the capacitor.config.ts

  3. Next thing, for my personal env, is that I didn't run XCode after updates, and it couldn't run it before I opened it and installed iOS. + went to the location in Xcode to fix, as per https://stackoverflow.com/questions/17980759/xcode-select-active-developer-directory-error
    image

  4. Another problem, the CocoaPods is missing which is again mentioned in the logs which can be seen on the screenshot above, but now it's a warning.

Now, the build passes
image

Also, I had to remove the IOS folder, and add the platform again, because my Xcode ran into some permission errors. Which I would guess could be a result of some sudo command or something. After platform was re-added – everything was built successfully in Xcode.

image

All I did is – read error messages, and fixed them.

@christian-bromann
Copy link
Member

@forrestlin2020 can you provide a minimal reproducible example?

At this point all we can do is to better document the warning from the compiler and that it can be ignored. If someone can provide anything reproducible that has a bigger user impact please share an example with us.

@gultyayev
Copy link

After changed back to @angular-devkit/build-angular:browser (Webpack), "ng build" works well.

What is the error you get? Any chance it's same as in the item 2 here?

If so, then you need to adjust your capacitor config. That's the only substantial difference between the old and the new builder. One more folder nesting level in the build output.

@gultyayev
Copy link

@forrestlin2020 it's not an error. It says "warning" in the logs. Look for "error" wording. Or, for red words. If you post the whole console output from the command input till the very end – this would help figuring what is wrong there.

You can also try Ctrl+F to search for "error" if the log is too big.

@gultyayev
Copy link

@forrestlin2020 I asked for the whole output. This piece that you have posted is not helpful to understand what problem you are facing.

Given the lack of information I can blindly guess that if you change your capacitor.config.ts so that it has webDir: 'www/browser',. And you return your application builder back in angular.json – everything would work.

@sohibegit
Copy link

This warning also occurs for me, but only when using esbuild with the following configuration:

angular.json
{
  "executor": "@angular-devkit/build-angular:application"
}
import type { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  appId: 'io.ionic.starter',
  appName: 'ionic0417',
  webDir: 'www/browser'
};

export default config;

@ahukkanen
Copy link

This same issue also can be replicated with the wc-datepicker package depending on stencil.

Replication instructions:

$ mkdir stencil-test && cd stencil-test
$ npm init -y && npm i wc-datepicker && npm i -D esbuild
$ echo 'import { WcDatepicker } from "wc-datepicker/dist/components/wc-datepicker";' > index.js
$ ./node_modules/.bin/esbuild index.js --bundle

alicewriteswrongs added a commit to ionic-team/stencil-site that referenced this issue May 1, 2024
This adds a note about the build issue documented in
ionic-team/stencil#5427 just so that users of
the Angular OT are forewarned.

STENCIL-1193
alicewriteswrongs added a commit to ionic-team/stencil-site that referenced this issue May 1, 2024
This adds a note about the build issue documented in
ionic-team/stencil#5427 just so that users of
the Angular OT are forewarned.

STENCIL-1193
alicewriteswrongs added a commit to ionic-team/stencil-site that referenced this issue May 1, 2024
This adds a note about the build issue documented in
ionic-team/stencil#5427 just so that users of
the Angular OT are forewarned.

STENCIL-1193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil
Projects
None yet
Development

No branches or pull requests

15 participants