l00k/devphase

Support yarn v2

h4x3rotab opened this issue · 2 comments

If I follow the official yarn v2 installation guide, I will end up with the following error:

root@c095c9f88cfd:~/project# yarn devphase --help
/root/project/devphase.config.ts:3
import { ConfigOption } from 'devphase';
^^^^^^

SyntaxError: Cannot use import statement outside a module

However if I rollback to yarn v1, everything works well.

l00k commented

Are you sure it is yarn v2?
Cuz as far as I know it has some issues with typescript installation (which is obviously required)
yarnpkg/berry#2935

I have checked v3 here I can reproduce error above.
Sadly I have no idea what may be the issue - for now it has lower priority.

l00k commented

Sadly that seems really hard to fix.
Closing for now.

Notes for future try:

  • branch esm created
  • after switching to yarn@^3.4 it is required to compile as esm and switch package type to module - cuz it is impossible to load devphase.config.ts outside of module (commonjs)
  • after mentioned changes there are issues in dependencies tree - @phala/sdk wrongly imports AxiosError from axios which is commonjs package