Node.js modules

#1

For now, using Node.js modules require some preparation with a laptop. You can use browserify --bare to squash all the dependencies into a file.

Open this deeplink on Safari to see an example:

playdotjs://28816c75

More context here.

0 Likes

#2

I’m getting an error when using the app url. The error says “Object bundles/28816c75| does not exist”.

0 Likes

#3

The link had a typo, try with playdotjs://28816c75 please :pray:

0 Likes

#4

Working now. Thanks for the quick response.

0 Likes

#5

Native node modules support is number one on my wish list. I’d prefer to not use my computer. But this is still excellent, and I appreciate all your hard work.

1 Like

#6

Hi mrbianhinton :wave:

I’ve just released play.js that simplifies working with dependencies among other things :slight_smile:

1 Like

#8

0 Likes

#9

Thanks for flagging, huoxiangdong. The issue has been addressed, a fix will be out soon :blush:.

0 Likes

#10

Consider adding pseudo-terminals to execute npm or something

3 Likes

#11

I bundle koa but no luck

0 Likes

#12

Hi Soydepr,

Can you please provide more details?

0 Likes

#13

Perhaps is my misunderstanding inside the folder I did browserify index.js -o bundle.js. Then move bundle.hs to folder I expected my script to run but I get requiere error

0 Likes

#14

To use modules you no longer need to use Browserify. Just declare your dependencies in package.json and tap on the “Play” button.

2 Likes

#15

Is there anything we can do to mimic the npm run environment? I can add npm as a dependency but I cannot make it run :cry: Can anyone please :pray: share with us an example of something that has the ability to run a script from package.json?

0 Likes

#16

Hi milotindragos :wave:

I’ve replied to your question here :slight_smile:.

1 Like

#17

Hey! I’m loving the concept of this App, but I have been unable to run my small webish node.js server app yet :sweat_smile:

I’m not sure if it’s because Play.js’s node version, because my experience developing node apps is limited, but I’m getting some errors with node_module WS (for WebSockets) that I don’t get on my workstation (Could it be because of an old ESXX version of Play.js, not recognizing that way of adding elements to an object, using ...objectName?)

?)

Any ideas? Thanks!

0 Likes

#18

Not sure what node version we’re running, but the object spread definitely does not work. It looks like WS was recently updated to 7.0.0, this dropped support for Node 6…so you might need to go to WS@6.2.1

0 Likes

#19

Hi all :wave:

We’ll be upgrading the embedded Node version to 10.13.0 soon. It’ll support the object spread operator among other new things. Thanks for your patience :slight_smile:.

1 Like

#20

Hi all :wave:

play.js 1.7.0 has been shipped and it now runs Node.js 10.13.0. Some of the issues above mentioned should now be fixed.

Thanks all for reporting bugs :slightly_smiling_face:

0 Likes

#21

Spread still does not appear to work in the latest app release. Simple example from http://kangax.github.io/compat-table/es2016plus/#test-object_rest/spread_properties is:

var spread = {b: 2, c: 3};
var O = {a: 1, ...spread};
return O !== spread && (O.a + O.b + O.c) === 6;

Result:

SyntaxError: Expected identifier, string or number
0 Likes