-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add public.api.ts #20616
Comments
I have the same problem |
Hi @andrei4ik1997! I've created a fresh project with Angular 17 and I've followed this documentation. I added Highcharts to my import Highcharts from 'highcharts/es-modules/masters/highcharts.src.js'; and my "build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/angular-17-issue",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
},
... With this config, I'm not able to recreate it: 🎲 >ng build
Initial Chunk Files | Names | Raw Size | Estimated Transfer Size
main-MWKZVL6Z.js | main | 429.44 kB | 130.21 kB
polyfills-RX4V3J3S.js | polyfills | 33.01 kB | 10.68 kB
styles-5INURTSO.css | styles | 0 bytes | 0 bytes
| Initial Total | 462.45 kB | 140.88 kB
Application bundle generation complete. [3.404 seconds] Could you please walk me through where the issue is and how I can recreate it? |
I am using native federation in my application. we also use polyfil es-module-shims. https://www.npmjs.com/package/es-module-shims err SyntaxError: The requested module 'blob:http://localhost:4250/f575146f-c973-4ac0-9f2e-25f94c855e4a' does not provide an export named 'default' (at highcharts-wrapper.component.ts:19:1)
|
I'm not familiar with these packages but it looks like they complain about the named export. Have you tried importing it like this: import gantt from 'highcharts/es-modules/masters/highcharts-gantt.src.js; With that, you don' have to import |
I tried all import options, but none of them work. |
@andrei4ik1997 wrote a good solution. |
I've tested that with the new Angular builder and it works fine. |
@karolkolodziej It might be a conflict with the declarations based on the JSDoc doclets. Declarations do not include the default export, because this is not part of the classic masters with global namespace. |
@karolkolodziej Yes, I also use native-federation and angular-highcharts(https://www.npmjs.com/package/angular-highcharts). I'll create a test application later to test this problem |
https://stackblitz.com/edit/stackblitz-starters-aptkaf?file=README.md you can also see the project here: @karolkolodziej check, please |
@kirill-borisyonok Thanks for reproducing the error. I also managed to find a solution from @omishyn ( https://github.com/omishyn/om-angular-highcharts/tree/main ). He copies modules to the external layer using nf-copy.js . But I think this is a dirty solution. Maybe there is a better solution? |
I did some investigation into mentioned project setups, and I noticed Highcharts imports that are not quite right. As mentioned earlier in this discussion:
The latter can be seen in the npm package |
what do you mean by "Also only one product bundle should be imported, while the other products should be imported as modules." |
@kirill-borisyonok These import statements might become problematic. See this documentation example for mixing products. |
@bre1470 I'll try this solution and come back with feedback. Thank you very much |
@bre1470 @karolkolodziej Hi, after investgate and many attempts, I came to the conclusion that the Angular Esbuilder swears at import via / . P.s. Using the official wrapper (https://www.npmjs.com/package/highcharts-angular) doesn't solve the problem index.ts examle |
@andrei4ik1997 @karolkolodziej Looks like this is something for the highcharts-angular wrapper to deal with. |
@karolkolodziej @bre1470 We'll be looking forward to the release ) |
Could you please describe it once again in the highcharts-angular repo |
@karolkolodziej maybe something has changed on this issue? |
Please add public.api.ts file to the root of the library in which all functions will be exported. This is needed for the new ESBuild builder on Angular.
Builder does not accept paths with slashes(for example highcharts/highmaps)
The text was updated successfully, but these errors were encountered: