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

Pointer events not firing when bundled with Parcel bundler #30

Closed
danmarshall opened this issue Dec 19, 2018 · 13 comments
Closed

Pointer events not firing when bundled with Parcel bundler #30

danmarshall opened this issue Dec 19, 2018 · 13 comments

Comments

@danmarshall
Copy link

Hello,
Sorry if this is not the right place to file this bug, but it appears it might be related to #13 ?

Setup

Install the Parcel bundler
npm install -g parcel

Repro case

  1. Clone deck.gl
  2. Navigate to deck.gl/examples/website/plot/
  3. Move this line of code from index.html to app.js:
App.renderToDOM(document.getElementById('app'));
  1. parcel serve ./index.html --open

Expected

Mouse / pointer events to orbit the view

Actual

View does not respond to mouse

@danmarshall
Copy link
Author

Note: it appears that the plot example is using deck.gl@6.2 which might not be using the most recent mjolnir.js

@Pessimistress
Copy link
Collaborator

Can you try the example on deck.gl's 6.3-release branch?

@danmarshall
Copy link
Author

Ok, switched to the 6.3-release branch, still seeing the same issue. The browser field in package.json must be a WebPack-specific feature?

@danmarshall
Copy link
Author

Hmmm I guess not - found some Parcel documentation that says it should: https://parceljs.org/module_resolution.html#package.json-%60browser%60-field

@danmarshall
Copy link
Author

... but it sounds like it only works as an alias for main. Example:

{
  "main": "build/d3.Node.js",
  "browser": "build/d3.js",
  "module": "index"
}

It does not appear to work with the current:

  "browser": {
    "./dist/cjs/utils/hammer.js": "./dist/cjs/utils/hammer.browser.js",
    "./dist/esm/utils/hammer.js": "./dist/esm/utils/hammer.browser.js"
  }

@Pessimistress
Copy link
Collaborator

Looks like it should? parcel-bundler/parcel#200

Can you inspect your bundle and see if hammer.js is included?

@danmarshall
Copy link
Author

hammer.js was included. I will try to see if browser-resolve is finding it correctly. BTW it does say it should support the way you are doing it:
https://github.com/defunctzombie/package-browser-field-spec#replace-specific-files---advanced

@danmarshall
Copy link
Author

hmmm, perhaps it is a Windows thing? parcel-bundler/parcel#1883 (comment)

@danmarshall
Copy link
Author

Hi @Pessimistress I have set up a simple repo to demonstrate this bug:
https://github.com/danmarshall/parcel-browser-field

I can close this issue if you aren't able to reproduce, it would then be a bug in Parcel.
Thank you for your patience! 👍

@Pessimistress
Copy link
Collaborator

Thanks for following up on this. Could you post an update here when it's resolved? I don't have a PC so it's been a little difficult for me to track compatibility on Windows.

@danmarshall
Copy link
Author

Yes I will follow up here. Meanwhile, can you try to repro on your Mac?

@danmarshall
Copy link
Author

Ok, bug does not repro on a Mac. Not your bug, sorry and thanks!

@danmarshall
Copy link
Author

Bug happens when the files are in subfolders - backslashes on windows do not match forward slashes in a path. I've sent a PR to Parcel.

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

No branches or pull requests

2 participants