navigation icon indicating copy to clipboard operation
navigation copied to clipboard

Safari doesn't work when using the default export and only works when using the rollup export

Open lucsoft opened this issue 1 year ago • 1 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure it has not already been reported

Version (i.e. v2.x.x)

1.0.1-alpha.199

Node.js version (i.e. 18.x, or N/A)

v21.5.0

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10, or N/A)

14.3

Description

Im bundling this polyfill via webpack.

Problem i found using @virtualstate/navigation/polyfill/rollup as an entrypoint and importing that works under Safari But @virtualstate/navigation/polyfill doesn not.

This only effects Safari after a reload (When its using its Cache, disabling the Cache works)

Steps to Reproduce

(coming soon)

Expected Behavior

No response

lucsoft avatar Feb 16 '24 15:02 lucsoft

Since you're using webpack, I would imagine it would be leaning towards needing a commonjs compatible module, which /polyfill/rollup is.

I've added the mapping for commonjs for just /polyfill to automatically pick between esm and cjs, let me know if this does the trick. Version 1.0.1-alpha.200 is publishing now with this change.

Let me know if this does the trick or not.

fabiancook avatar Feb 17 '24 02:02 fabiancook