Skip to content

fix: handle hastscript no-default-export + unblock fresh install/start#7793

Open
pranjalisr wants to merge 4 commits intowebpack:mainfrom
pranjalisr:fix/hastscript-no-default-export
Open

fix: handle hastscript no-default-export + unblock fresh install/start#7793
pranjalisr wants to merge 4 commits intowebpack:mainfrom
pranjalisr:fix/hastscript-no-default-export

Conversation

@pranjalisr
Copy link
Contributor

@pranjalisr pranjalisr commented Feb 8, 2026

Fixing #7789
Summary

This PR fixes the startup failure caused by importing hastscript as a default export, which is not supported in newer versions of the package.
When running yarn start (or npm start) on a fresh setup, the project fails with:
SyntaxError: The requested module 'hastscript' does not provide an export named 'default'

This change updates the hastscript import logic in webpack.common.mjs to safely resolve the export regardless of whether it is provided as:
a default function export
a named h export
or a CommonJS-style default object

Additionally, while reproducing the issue on a clean environment (Node 20+), the following blockers were identified and resolved:
Updated react-tiny-popover to resolve peer dependency conflicts with React 17.
Aligned src/sw.js Workbox imports with Workbox v7.
Added explicit Workbox dependencies to satisfy ESLint and module resolution.
Ensured npm install, npm run lint:js, and npm start all succeed on a fresh clone.

What kind of change does this PR introduce?
Fix.

Did you add tests for your changes?
No.
This change fixes configuration/import issues in the build setup and service worker, and does not modify application runtime logic. Existing functionality remains unchanged.

Does this PR introduce a breaking change?
No.
The changes restore compatibility with newer dependency versions and do not alter public APIs or runtime behavior.

No documentation changes are required.
This PR only restores compatibility with newer versions of hastscript and related dependencies.

Verification:
After applying the changes:

  • npm install succeeds
  • npm run lint:js passes
  • npm start runs successfully
Screenshot 2026-02-08 at 19 54 57

@vercel
Copy link

vercel bot commented Feb 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-js-org Ready Ready Preview, Comment Feb 8, 2026 2:49pm

Request Review

package.json Outdated
"workbox-routing": "^7.4.0",
"workbox-strategies": "^7.4.0",
"workbox-cacheable-response": "^7.4.0",
"workbox-expiration": "^7.4.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you add them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were added while resolving the Workbox import issues locally. After reworking the sw.js imports, they’re not strictly necessary as direct dependencies anymore since workbox-webpack-plugin already brings them in.

I can remove them to avoid unnecessary dependency additions and keep the change focused on the hastscript fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed them successfully.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont know but seems ai generated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants