emberjs / ember-render-modifiers

Implements did-insert / did-update / will-destroy modifiers for emberjs/rfcs#415
MIT License
86 stars 33 forks source link

Node 12/14 unsupported? #36

Open stephencweiss opened 3 years ago

stephencweiss commented 3 years ago

As Node 10 is coming up on EOL, I tried to update my project to Node 14 (and 12). In both cases, when I did, I got the following build error:

Build Error (broccoli-persistent-filter:Babel > [Babel: @ember/render-modifiers]) in @ember/render-modifiers/modifiers/did-insert.js

No "exports" main defined in /Users/stephen.weiss/code/olo/expo-web-client/node_modules/@ember/render-modifiers/node_modules/@babel/helper-compilation-targets/package.json

Stack Trace and Error Report: /var/folders/dz/43k2z2yn53g6g5wgzbx0gw8m0000gp/T/error.dump.f35dc8ac0b4685c4fa73ca1fd5ee7483.log

Is there anything we can do to accommodate newer Node versions? Or is there any recommended path forward?

My believe is that I am currently only using this in one place:

<form onKeyPress={{action this.handleKeyPress}} onSubmit={{action this.handleFormSubmit}}
          {{did-insert this.handleFormInsert}} tabindex="0">
    //...
</form>

where handleFormInsert is really meant to just add focus:

  handleFormInsert(element) {
    element.focus();
  }
boris-petrov commented 3 years ago

@stephencweiss - I've been using this package for a long time, right now on Node 15, but before that on Node 14. I've never seen that error. Are you sure it's related to Node's version? I would find that strange.

stephencweiss commented 3 years ago

@boris-petrov certainly not sure of it, but was pretty sure that was the only change I'd made to the project. Will give it another shot today to confirm.

stephencweiss commented 3 years ago

Confirmed, the only change in my project is that I bumped node from v10 to v14.16. Now it won't compile.

stephencweiss commented 3 years ago

Fwiw - the error seems right, when I follow the error and look at @ember/render-modifiers/node_modules/@babel/helper-compilation-targets/package.json, I see the following:

{
  "name": "@babel/helper-compilation-targets",
  "version": "7.8.3",
  "author": "The Babel Team (https://babeljs.io/team)",
  "license": "MIT",
  "description": "Engine compat data used in @babel/preset-env",
  "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-compilation-targets",
  "main": "lib/index.js",
  "exports": false,
  "publishConfig": {
    "access": "public"
  },
  "keywords": [
    "babel",
    "babel-plugin"
  ],
  "dependencies": {
    "@babel/compat-data": "^7.8.1",
    "browserslist": "^4.8.2",
    "invariant": "^2.2.4",
    "levenary": "^1.1.0",
    "semver": "^5.5.0"
  },
  "peerDependencies": {
    "@babel/core": "^7.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.8.3",
    "@babel/helper-plugin-test-runner": "^7.8.3"
  },
  "gitHead": "a7620bd266ae1345975767bbc7abf09034437017"
}

Note the exports key.