GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bug(typebox): Typebox package should export the Value APIs · Issue #2927 · feathersjs/feathers

bug(typebox): Typebox package should export the Value APIs #2927

New issue
Copy link
New issue
Copy link
Open
Open
bug(typebox): Typebox package should export the Value APIs#2927
Copy link

Description

@lvivier
lvivier
opened on Dec 14, 2022
Issue body actions

Steps to reproduce

The @feathersjs/typebox package doesn't export the super useful values module.

Happy to submit a PR for this.

Expected behavior

import { Value } from '@feathersjs/typebox/value';

Value.Cast(DataSchema, ctx.data); // for example

Actual behavior

"Cannot find module"

System configuration

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working):

  • @feathersjs/[email protected]
    • @feathersjs/[email protected]

NodeJS version: 16.13.2

Operating System: macOS

Browser Version:

React Native Version:

Module Loader:

Reacted by Ray Foss

Activity

  1. daffl commented on Jan 30, 2023

    @daffl
    daffl
    on Jan 30, 2023
    Member
    More actions

    This is strangely turning out to be more complicated than I thought. For some reason just declaring the exports in our package.json like it is done in TypeBox itself does not work (this is also part of the problem of ESM builds in #2665).

    Since the dependency gets installed automatically anyway, I recommend loading it from @sinclair/typebox direclty.

  2. FossPrime commented on Jun 5, 2023

    @FossPrime
    FossPrime
    on Jun 5, 2023
    Member
    More actions

    Another workaround would be to load from ./node_modules/ directly. You can go as far as to use subpath exports to make it easier to do this in several files.

    @daffl If a package inside node_modules that doesn't support ESM loads a package, any package, it will always pick the CommonJS version, even if the user-land package.json is set to type=module.

    You could have also ran into an issue with conditional exports and how you have to the more specific conditions like "node", "deno" and "development" above vague ones like "default" or "browser".

    I'm happy to help get these issues expedited... I was hoping to have a CJS problem free year... i've been dealing with this since 2019 as you know.

  3. FossPrime
    changed the title [-]Typebox package should export the Value APIs[/-] [+]bug(typebox): Typebox package should export the Value APIs[/+] on Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.