Git Product home page Git Product logo

Comments (15)

xdave avatar xdave commented on June 12, 2024 1

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.

kriskowal avatar kriskowal commented on June 12, 2024

This is perplexing since ASAP already has these redirects in its own package.json.

from asap.

kevinbeaty avatar kevinbeaty commented on June 12, 2024

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.

kriskowal avatar kriskowal commented on June 12, 2024

Ah, that rings a bell. Browserify is picky about such things.

from asap.

kriskowal avatar kriskowal commented on June 12, 2024

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.

Macil avatar Macil commented on June 12, 2024

Probably related: browserify/browserify#1119

from asap.

Macil avatar Macil commented on June 12, 2024

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.

kriskowal avatar kriskowal commented on June 12, 2024

@agentme Note above that I committed and published fixes for Browserify. Please confirm that these were not sufficient.

from asap.

Macil avatar Macil commented on June 12, 2024

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.

ewie avatar ewie commented on June 12, 2024

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.

kriskowal avatar kriskowal commented on June 12, 2024

@ewie. Sending a fix up now.

from asap.

ewie avatar ewie commented on June 12, 2024

@kriskowal. Damn you're quick 😄. I was just preparing a PR.

from asap.

kriskowal avatar kriskowal commented on June 12, 2024

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.

ewie avatar ewie commented on June 12, 2024

@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.

kriskowal avatar kriskowal commented on June 12, 2024

@ewie I mean 2.0.2, which I forgot to push. Fixed.

from asap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.