Comments (15)
I'm attempting to use https://github.com/Khan/aphrodite in a project that I'm building with https://github.com/fuse-box/fuse-box
The browser
mapping doesn't seem to work with fuse-box
(it works for the entry point, but not the other internal modules, such as raw
).
The only way I can make this work is by changing:
var rawAsap = require("./raw");
to
var rawAsap = require("./browser-raw");
in browser-asap.js
.
from asap.
This is perplexing since ASAP already has these redirects in its own package.json.
from asap.
Yes, it was strange. Note that I did modify the ASAP package.json to specify the file paths (./asap.js
as opposed to asap
as indicated above) in my local clone of ASAP and that did fix the problem for browserify. If I made these modifications to ASAP package.json, no changes were required for my requiring module.
from asap.
Ah, that rings a bell. Browserify is picky about such things.
from asap.
Committed a change to master. Unfortunately, this broke the build tooling, which says less about ASAP and more about Mr v2, I expect.
from asap.
Probably related: browserify/browserify#1119
from asap.
I published the asap-browser
package to NPM to work around this issue for now. It's the same as asap with kevinbeaty's changes applied (main is now browser-asap.js, and browser-asap.js requires browser-raw).
from asap.
@agentme Note above that I committed and published fixes for Browserify. Please confirm that these were not sufficient.
from asap.
Your changes in ASAP did not fix the issue for me. I've been getting inconsistent behavior from Browserify, so I think it's a Browserify bug. I've seen the following combinations of things end up in the browserified bundle: asap.js and browser-raw.js, browser-asap.js and raw.js, and asap.js and raw.js.
from asap.
The problem also occurs with webpack.
Modifying package.json
as pointed out by @kevinbeaty solves it for me.
"browser": {
"./asap.js": "./browser-asap.js",
"./raw.js": "./browser-raw.js",
"./test/domain.js": "./test/browser-domain.js"
}
I don't know if the browser
field is properly defined somewhere.
The only source I could find is https://gist.github.com/defunctzombie/4339901/49493836fb873ddaa4b8a7aa0ef2352119f69211#replace-specific-files---advanced which shows that the keys under the browser
field should be relative paths apparently including the file extension.
from asap.
@ewie. Sending a fix up now.
from asap.
@kriskowal. Damn you're quick 😄. I was just preparing a PR.
from asap.
I do my github gardening on Saturdays. I’ve pushed a patch release. I verified locally that it works with Browserify, but as always, mileage will vary. Please let me know if there are further problems.
from asap.
@kriskowal. I guess you mean release 2.0.1. That doesn't solve the problem for webpack. As I wrote in my first comment you probably have to specify the browser
field in terms of relative file paths (including the file extensions which are missing from the keys in 588bb88).
from asap.
@ewie I mean 2.0.2, which I forgot to push. Fixed.
from asap.
Related Issues (20)
- Cross library interleaving can cause node 10's nextTick limit to be hit. HOT 1
- Publish a new version HOT 4
- function to change rawAsap.capacity value must be added HOT 3
- Consider using Promise.prototype.then HOT 4
- asap queue can be effectively overflown (using [email protected]) HOT 2
- Usability in development mode with thrown errors HOT 5
- Browser field contains invalid route in npm HOT 8
- Microtask queue can be made faster HOT 4
- asap uses timer, not MutationObserver, in Safari HOT 1
- react-native throw Error when importing asap HOT 8
- Chrome + postMessage = slow HOT 1
- Source is poinitng to internal uber repo HOT 3
- npm published version 2.05 is not in git HOT 1
- Browser-asap requiring wrong raw file (non-browser version). HOT 4
- Does asap have an ECCN? HOT 2
- Contributors? HOT 1
- Use queueMicrotask? HOT 2
- esbuild fails: "browser" field is not according to spec
- TypeError: t.observe is not a function. (In 't.observe(l,{characterData:!0})', 't.observe' is undefined) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asap.