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

Could not resolve "../screen" #274

Closed
prescience-data opened this issue Oct 27, 2021 · 0 comments · Fixed by #325
Closed

Could not resolve "../screen" #274

prescience-data opened this issue Oct 27, 2021 · 0 comments · Fixed by #325

Comments

@prescience-data
Copy link

prescience-data commented Oct 27, 2021

Description

Encountered issue when bundling with esbuild:

Error: Build failed with 1 error:
../../../common/temp/node_modules/.pnpm/@oclif+core@1.0.2/node_modules/@oclif/core/lib/errors/errors/cli.js:40:38: error: Could not resolve "../screen"
  ...20 lines omitted...
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Could not resolve "../screen"'
    }
  ],
  warnings: []
}
ERROR: "build:esbuild" exited with 1.

Cause

Is there a reason you guys are mixing inline requires with import syntax? I've found this can cause a lot of issues in the past and can't see any obvious benefit?

Examples

The last link is specifically the line that throws the error described, but I imagine there will be a lot of others once this is resolved if this one has managed to get through your CI / tests given that the ../screen file doesn't exist.

See here for ../ directory (note the screen file exists in the next level up):

This would be avoided by enforcing typescript-eslint/no-require-imports with a hard error during build.

These inline requires are not handled well by the tsc compiler whereas using top of page imports will have definitely failed to build, alerting you to the error much sooner before publishing.

Context

  • @oclif/core 1.0.2
  • esbuild 0.13.9
  • typescript 4.4.3
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

Successfully merging a pull request may close this issue.

1 participant