Skip to content
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

No longer builds on NodeJS v12+ #2582

Closed
nicholascioli opened this issue Jun 21, 2019 · 0 comments
Closed

No longer builds on NodeJS v12+ #2582

nicholascioli opened this issue Jun 21, 2019 · 0 comments

Comments

@nicholascioli
Copy link
Contributor

Problem statement

As of NodeJS version 12.4.0, the default gulp build target (blockly_javascript_en)
fails.

Expected Behavior

It should build successfully.

Actual Behavior

The gulp rule fails.

Steps to Reproduce

  1. Use NodeJS version 12.4.0
  2. Add blockly as a dependency using npm or yarn

Stack Traces

$ gulp blockly_javascript_en
fs.js:27
const { Math, Object } = primordials;
                         ^

ReferenceError: primordials is not defined
    at fs.js:27:26
    at req_ (blockly/node_modules/natives/index.js:143:24)
    at Object.req [as require] (blockly/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (blockly/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:774:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:681:19)
    at require (internal/modules/cjs/helpers.js:16:16)

Operating System and Browser

Tested on Mac OS X Mojave and Firefox (although, the browser is not the issue here).

Additional Information

Updating gulp to version 4 should fix this issue.

@nicholascioli nicholascioli mentioned this issue Jun 21, 2019
3 tasks
rachel-fenichel added a commit that referenced this issue Nov 14, 2019
#2582 means we should be fine now.

Needs travis to run to check.
nijil-deriv pushed a commit to binary-com/binary-bot that referenced this issue Jun 1, 2021
* Pin js-interpreter to version 2.2.0

There's an incompatible version 2.3.0 of js-interpreter currently,
which generates the following error at runtime:
`t.nativeGlobal.String is not a function`
which comes from the Interpreter.prototype.initString

For now, we're going to sidestep this by using the version we last
released with. In the long run, we should address the actual issue.

* Fix inconsistent circleci images and failing build

We were building with different versions of node for actual releases
and dev / staging. We should be consistent always so that the artifcacts
we deploy are the same ones we actually tested.

We're also moving from circleci: to cimg: because they deprecated
the old images and asked us to move.

Finally, we're moving to 12.18 because we've seen this image trying to
build on 12.13 without a cache.
We think that builds have only been working because of the circleci
cache of node_modules.
It looks from the builds, like [this
one](https://app.circleci.com/pipelines/github/binary-com/binary-bot/405/workflows/cfe00f01-7ee4-45d5-a4ed-a618e657789f/jobs/426)
that it was getting blockly and gulp from the existing cache

See [this github issue in
blockly](google/blockly#2582).

This is a stepping stone. We need to fix the dependencies, upgrade
blockly, consistently use yarn OR npm, and commit package-lock or
yarn.lock as we work.

This is just an incremental fix.

See also [exiting task](https://redmine.deriv.cloud/issues/8729).

* Generate a new package-lock

Generated with node:12.18.0-buster since that's the only one that
doesn't error

We're okay to replace the existing package-lock because it hasn't been
used to generate the production releases.

* Added yarn.lock file generated from package-lock

The build process in circleci currently uses yarn,
but without a lock file.

This commits a lock file from today's package-lock, giving us some
stability

* Fix blockly 1 building with gulp 4

We had been pinning our version of blockly to a version sha.
However now gulp 3 wouldn't build with node 12.

This commit pins it to our own forked version of blockly,
until we get to upgrade to the latest.

This does a fresh build of npm install and yarn import on
`node:12.18.0-buster` but this should then build okay on the circleci
version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants