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

Packaging issues, no type declared #277

Open
digitaltopo opened this issue Jul 26, 2024 · 1 comment
Open

Packaging issues, no type declared #277

digitaltopo opened this issue Jul 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@digitaltopo
Copy link

Description

The library seems to be packaged incorrectly, and therefore does not import into applications built (for example) with vite.

Reproduce

Please see: https://publint.dev/@datalayer/[email protected]

Expected behavior

package should import properly

Context

  • Datalayer version: "@datalayer/jupyter-react": "^0.15.0",
  • Operating System and version: Node 20
Console Output ``` [ERROR] Unexpected token 'export' Stack trace: at internalCompileFunction (node:internal/vm:128:18) at Module._compile (node:internal/modules/cjs/loader:1332:27) at Module.load (node:internal/modules/cjs/loader:1206:32) at cjsLoader (node:internal/modules/esm/translators:366:17) at ModuleJob.run (node:internal/modules/esm/module_job:222:25) [...] See full stack trace in the browser, or rerun with --verbose. ```
@digitaltopo digitaltopo added the bug Something isn't working label Jul 26, 2024
@echarles
Copy link
Member

Hi @digitaltopo The package is used in some vite app, e.g. https://github.com/datalayer-examples/jupyter-react-vite-example

I see the report from the link you shared. Do you have an idea on how to fix that. Happy to review a PR :)

The package does not specify the "type" field. NodeJS may attempt to detect the package type causing a small performance hit. Consider adding "type": "commonjs". ([More info](https://publint.dev/rules.html#use_type))
/lib/index.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. /lib/index.mjs ([More info](https://publint.dev/rules.html#file_invalid_format))
/style/index.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. /style/index.mjs ([More info](https://publint.dev/rules.html#file_invalid_format))
/lib/examples/All.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. /lib/examples/All.mjs ([More info](https://publint.dev/rules.html#file_invalid_format))
/lib/app/App.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. /lib/app/App.mjs ([More info](https://publint.dev/rules.html#file_invalid_format))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants