-
Notifications
You must be signed in to change notification settings - Fork 18
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
Webpack Build Failure Due to Missing Extensions in @deck.gl-community/editable-layers #117
Comments
@maslunde Thanks for reporting.
I doubt that the lack of |
My apologies, I will ask you to move general help requests like this to the Discussions tab. Issues are for actionable, well-defined bugs. I have updated the github issue template to explain this so you don't have to file your issue twice in the future. Once we narrow down the root cause, we file an issue. |
Found a solution and it was connected to webpack. In Webpack 5, a new behavior was introduced where the With this I updated webpack config with this and it works.
I'm not 100% sure, but I think this config would be unnecessary if your package had been explicit with the file extensions in the exports. Webpack 5 introduced stricter handling of module resolution to enforce explicit file extensions, aligning with the ECMAScript module specification. I have made some libs and are always explicit with the file extensions on the exports. |
Ah, shit happens. Good we found out :) Cheers |
Landed, pending #126 |
Published in v9.0.3, sorry for the long delay |
Hello,
I am encountering a problem with the @deck.gl-community/editable-layers package. Specifically, Webpack fails to resolve certain modules due to missing file extensions. This issue is causing build errors in my project.
Error Details:
When attempting to import from @deck.gl-community/editable-layers, I receive the following error:
Steps to Reproduce:
Install the @deck.gl-community/editable-layers package.
Import modules from @deck.gl-community/editable-layers in a Webpack project:
import { EditableGeoJsonLayer, DrawPolygonMode, ViewMode, ModifyMode } from '@deck.gl-community/editable-layers';
Run Webpack build.
Expected Behavior:
Modules should be resolved correctly without requiring explicit file extensions in import paths.
Actual Behavior:
Webpack fails to resolve the module due to missing file extensions, resulting in build errors.
Proposed Solution:
The issue seems to be related to the ES module specification, which requires explicit file extensions. Here are some suggestions to address the issue:
Update Import Paths: Ensure all internal import statements in the package include file extensions. For example:
import { memoize as _memoize } from './utils/memoize.js';
Package Updates: If this is a known issue, releasing an updated version with the necessary fixes would be appreciated.
Node.js and Webpack Versions:
Node.js: 20.14.0
Webpack: 5.93.0
Thank you for your assistance. Please let me know if you need any more information or if there are any workarounds available.
Best regards,
Martin
The text was updated successfully, but these errors were encountered: