Comments (10)
I think I have the same problem with popper.js. The program fails to load:
var _popper = _interopRequireDefault(require("popper.js"));
When I bundle it with webpack, it works fine.
from moduleserve.
This popped up due to Reason React quick-start template starting to use moduleserve (instead of webpack dev server), and Ant Design depending on omit.js, so the combo didn't work. So there might more users to moduleserve in the future due to this Reason connection :)
from moduleserve.
We've got the same issue with our demo page for bs-mui (material ui); Pointing it to 7db414e makes it work.
from moduleserve.
Could you see if attached patch helps for you?
from moduleserve.
It doesn't seem to help. I think the problem is already in generating the request, as I'm seeing:
http://localhost:8000/moduleserve/mod/src/Index.bs/__mod/omit
which is already missing the .js suffix. Perhaps because of client.js
var resp = get(base + name.replace(/(^|\/)\.\.(?=$|\/)/g, "$1__").replace(/\.js$/, ""))
from moduleserve.
Ah, right, I only tested with curl, didn't actually go through the client.
That is a more complicated problem, since the client doesn't have the information needed to figure out whether a given module name can be safely normalized.
This system of normalization is intended to reduce the amount of requests the loader has to make—we need to address every module via a canonical URL to make caching (HTTP caching as well as local module instance caching) work. The assumption is that most modules will be require
-d with a suffix-less name, so the server considers those names to be their canonical URL, to avoid an extra redirect for such names.
That turns out to be problematic. I expect it does avoid a lot of requests in typical code, but it is unclear how to work around this issue with it.
I'm probably not going to put more time into searching for a solution, since this is just a package that I use as a utility in some of my projects, and none of these projects have this issue. But if you have ideas for solution, let me know.
from moduleserve.
If I look at the resolving algorithm at https://nodejs.org/api/modules.html#modules_all_together there is no dropping of .js
suffix when loading modules. So is that even needed?
from moduleserve.
As I mentioned above, it's a hack to reduce the number of requests.
from moduleserve.
I have the same problem with popper.js that is being used by material-ui
from moduleserve.
@marijnh: just a note, I had the same issue with dinero.js (through react-dinero). Switching to 7db414e solved it for me, albeit with an extra request (well worth it to me).
from moduleserve.
Related Issues (5)
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 moduleserve.