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

Adaptor tests will fail in node19 #187

Open
josephjclark opened this issue Dec 22, 2022 · 1 comment
Open

Adaptor tests will fail in node19 #187

josephjclark opened this issue Dec 22, 2022 · 1 comment

Comments

@josephjclark
Copy link
Collaborator

Node 19 is getting stricter about ESM modules and removing the --experimental-module-specifier flag.

Here are some big changes coming to node19 which will catch us out:

  • Relative imports MUST have a file extension (ie import {} from './Adaptor becomes import {} from './Adaptor.js)
  • Folder imports will not work ((ie import {} from './src becomes import {} from './src/index.js)
  • lodash-fp, which many adaptors depend on, is deprecated. Strictly speaking we should be using lodash/fp, although this isn't itself ESM compliant (see lodash/issues/5285)

The upshot of all this is that tests and maybe builds will fail when we upgrade node beyond v18.

I actually thought the experimental arguments enabled future features early. Turns out they're actually masking deprecated functionality. Whoops - that's my bad.

Note that this doesn't affect any of the built and deployed adaptors - those are ESM and CJS compliant.

@taylordowns2000 taylordowns2000 moved this to Icebox in v2 Feb 3, 2024
josephjclark pushed a commit that referenced this issue Jun 11, 2024
describe-package: recognise magic functions
@josephjclark
Copy link
Collaborator Author

Switching to @swc/loader should fix this - see OpenFn/kit#833 for reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Icebox
Development

No branches or pull requests

1 participant