-
Notifications
You must be signed in to change notification settings - Fork 11
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
No matching export in "@app-config/esbuild:@app-config/main" for import "loadConfig" #208
Comments
One more thing to note here, you have a dependency on openpgpjs 4.x, which has a problem with bundlers. {
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module 'asn1.js'",
"stack": [
"Runtime.ImportModuleError: Error: Cannot find module 'asn1.js'",
"..."
]
} This is mentioned in some issues like this and also this one from the official openpgpjs repo. They fixed it on version 5.x, so I appreciate if you could update your version as well! I just tested it with an override on my package.json and it worked liked a charm on AWS Lambda: "overrides": {
"@app-config/main": {
"openpgp": "5.4.0"
}
} |
Thanks for the report! I've primarily worked on the esbuild plugin for web apps, so We should be able to upgrade openpgp as well, hopefully without breaking changes. |
Release notes: https://github.com/openpgpjs/openpgpjs/releases/tag/v5.0.0 I believe this would necessitate a breaking change in app-config's API, unfortunately, because we do re-export |
Understood! I can live with my workaround right now since I'm not using encrypted config properties. On a side note, I'd like to leave a suggestion for maybe putting all the encryption functionality on a separate package. Check this report from bundle-buddy.com for my application: openpgp and node-forge are responsible for half of my bundle size and I'm not even using them. |
For sure! This is a core goal of the theoretical V3 already. Encryption is a separate package, but it was included as a "default" parsing extension, so it's included in bundles at the moment. A big part of V3 is to remove more default extensions, letting users choose what they want. |
UPDATE (but please see next comment!)
Ok, I realize my mistake now. 😳
I just understood that by default the esbuild plugin will bundle (inline) the configuration files and there's no need to use
loadConfig
anymore. My initial impression was that the plugin was needed to provide some compatibility with esbuild and solve some bundling problem (like the one I mention on the next comment).This should be more clear in the docs. I only realized it because I was going through the esbuild plugin source code and I found it has an undocumented options object where
noBundledConfig = false
.The text was updated successfully, but these errors were encountered: