Skip to content

[JS] unable to import subpackages (smoldot/worker, smoldot/bytecode, etc.) with parcel #1923

@voliva

Description

@voliva

Some of the JS tooling is unable to resolve subpaths (smoldot/worker, smoldot/bytecode, smoldot/no-auto-bytecode). I could reproduce it with parcel in this repo + branch

> parcel src/index.html

(node:29823) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Server running at http://localhost:1234
🚨 Build failed.

@parcel/core: Failed to resolve 'smoldot/worker' from './src/worker.ts'

  /Users/victor/development/papi/playgrounds/parcel/src/worker.ts:1:8
  > 1 | import "smoldot/worker";
  >   |        ^^^^^^^^^^^^^^^^
    2 | 

@parcel/resolver-default: Cannot load file './worker' from module 'smoldot'

I think this is due to missing a specific package.json on the root of smoldot package, every library that exports subpackages have them defined.

I'll open a PR with this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions