Skip to content
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

FormDataPolyfill beta64 breaks webpack build #666

Closed
calebwoods opened this issue Feb 9, 2022 · 4 comments
Closed

FormDataPolyfill beta64 breaks webpack build #666

calebwoods opened this issue Feb 9, 2022 · 4 comments
Assignees
Labels
bug Things that aren't working right in the library.

Comments

@calebwoods
Copy link

Describe the bug

This bug causes an issue trying to install the latest beta64 in Rails/Webpack environment.

Tracing the error it seems to be related to this new FormDataPolyfil that was introduced in beta64. Specifically this line 33afecf#diff-c91850d5769c47753bcfba7194f46b93902d7ae3b5c22bc5a2261b4b55023685R66

To Reproduce

Steps to reproduce the behavior:

  1. Install Beta64 and try build with webpack
  2. See error

Screenshots

Screen Shot 2022-02-09 at 6 14 49 PM

@calebwoods calebwoods added the bug Things that aren't working right in the library. label Feb 9, 2022
@calebwoods calebwoods changed the title FormDataPolyfill beta64 break webpack build FormDataPolyfill beta64 breaks webpack build Feb 9, 2022
@claviska
Copy link
Member

claviska commented Feb 9, 2022

This will probably need a webpack config or an example repo to reproduce. Are you able to provide one?

@calebwoods
Copy link
Author

calebwoods commented Feb 9, 2022

Here ya go https://github.com/calebwoods/shoelace_bug just stock Rails 6.1.x app with Shoelace beta64 installed according to the instructions in the site. If I downgrade to beta63 everything works as expected.

@claviska
Copy link
Member

I couldn't get the repo to run locally, but I'm 99% sure this is solved in a57526a. The problem is that it's being executed before document.body exists, so checking the ready state should cover all scenarios. If this doesn't solve it for you, please post an update and I'll reopen.

@WickyNilliams
Copy link

Good catch, document.body is not defined in <head>.

I think this is why i didn't actually call the polyfillFormDataEvent function in my original code: I left for users to do whenever makes sense. But this seems like a reasonable approach if you always want the polyfill applied and not burden users with it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that aren't working right in the library.
Projects
None yet
Development

No branches or pull requests

3 participants