-
Notifications
You must be signed in to change notification settings - Fork 521
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
Correct way to use Steal on Node? #800
Comments
The canonical way would be: var steal = require("steal");
steal.import("my-main").then( ... steal.import will take care of making sure startup has been called. As for your builtins issue, you might try using node-locate which should resolve to the Node's own builtins. This is an experimental module (intended for 1.1) so your results may vary, but it's worth a shot. Would be something like: var steal = require("steal");
var nodeLocate = require("@stealjs/node-locate");
// This configures steal to use the extension
nodeLocate(steal.System);
steal.import("my/main").then( ... |
Thanks for the response. Results:
|
Thanks, 1&2 are bugs, with 3 I'm not sure about, can you recreate it in the browser? |
Re. 1&2: Done: #802 3: I’ll try and create a minimal case to reproduce it. |
Ok, here’s a test case — not with the same lib, but it looks like it might be the same cause: https://gist.github.com/stucox/889767b4677818fbcefe35c1138a781e (reproduced in the browser without |
Thanks, will take a look. |
Sorry about the silence — after a bit of absence, I tried the test case above with Have got as far as finding out it’s down to the path normalization — maybe it doesn’t deal with the Will report back when I have more. |
I was going to possibly take a look today. |
Moved this over to stealjs/steal-npm#192 |
I have some code I wrote to use client-side, but would like to reuse it on the server. It currently depends on my Steal config — specifically a YAML
translate()
plugin. In general it’d be nice if I could have my Steal config apply both on client & server.My naive attempt to run my code on Node with Steal in control was:
But my server-side code also includes modules which use Node builtins, which aren’t found.
I tried adding steal-builtins — but I realised that’s more designed to provide would-be-node modules in the browser — e.g.
require('http')
loads http-browserify, which realises it’s not running in a browser so throws a ‘no window object present
’ error.I saw that #749 brings these into core — but looks like it’s still using http-browserify, so I’d guess the same issue would arise?
The text was updated successfully, but these errors were encountered: