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 "@jsonjoy.com/util/lib/buffers/isUint8Array" #687

Open
macmillen opened this issue Aug 5, 2024 · 2 comments
Open

Could not resolve "@jsonjoy.com/util/lib/buffers/isUint8Array" #687

macmillen opened this issue Aug 5, 2024 · 2 comments

Comments

@macmillen
Copy link

When I try to import json-joy like this:

  import { Model, s } from "json-joy/lib/json-crdt";

I get this error:

 ✘ [ERROR] Could not resolve "@jsonjoy.com/util/lib/buffers/isUint8Array"

     node_modules/json-joy/lib/json-crdt-patch/PatchBuilder.js:6:31:
       6 │ const isUint8Array_1 = require("@jsonjoy.com/util/lib/buffers/isUint8Array");
         ╵                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   You can mark the path "@jsonjoy.com/util/lib/buffers/isUint8Array" as external to exclude it from
   the bundle, which will remove this error and leave the unresolved path in the bundle. You can also
   surround this "require" call with a try/catch block to handle this failure at run-time instead of
   bundle-time.

 ✘ [ERROR] Could not resolve "@jsonjoy.com/util/lib/buffers/isUint8Array"

     node_modules/json-joy/lib/json-crdt/nodes/rga/AbstractRga.js:5:31:
       5 │ const isUint8Array_1 = require("@jsonjoy.com/util/lib/buffers/isUint8Array");
         ╵                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   You can mark the path "@jsonjoy.com/util/lib/buffers/isUint8Array" as external to exclude it from
   the bundle, which will remove this error and leave the unresolved path in the bundle. You can also
   surround this "require" call with a try/catch block to handle this failure at run-time instead of
   bundle-time.

 ✘ [ERROR] Could not resolve "@jsonjoy.com/json-pack/lib/cbor/CborDecoder"

     node_modules/json-joy/lib/json-crdt-patch/codec/binary/Decoder.js:7:30:
       7 │ const CborDecoder_1 = require("@jsonjoy.com/json-pack/lib/cbor/CborDecoder");
         ╵                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   You can mark the path "@jsonjoy.com/json-pack/lib/cbor/CborDecoder" as external to exclude it from
   the bundle, which will remove this error and leave the unresolved path in the bundle. You can also
   surround this "require" call with a try/catch block to handle this failure at run-time instead of
   bundle-time.

 ✘ [ERROR] Could not resolve "@jsonjoy.com/util/lib/buffers/Writer"

     node_modules/json-joy/lib/json-crdt-patch/util/binary/CrdtWriter.js:4:25:
       4 │ const Writer_1 = require("@jsonjoy.com/util/lib/buffers/Writer");
         ╵                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   You can mark the path "@jsonjoy.com/util/lib/buffers/Writer" as external to exclude it from the
   bundle, which will remove this error and leave the unresolved path in the bundle. You can also
   surround this "require" call with a try/catch block to handle this failure at run-time instead of
   bundle-time.

 ✘ [ERROR] Could not resolve "@jsonjoy.com/json-pack/lib/cbor/CborEncoder"

     node_modules/json-joy/lib/json-crdt/codec/structural/binary/Encoder.js:9:30:
       9 │ const CborEncoder_1 = require("@jsonjoy.com/json-pack/lib/cbor/CborEncoder");
         ╵                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   You can mark the path "@jsonjoy.com/json-pack/lib/cbor/CborEncoder" as external to exclude it from
   the bundle, which will remove this error and leave the unresolved path in the bundle. You can also
   surround this "require" call with a try/catch block to handle this failure at run-time instead of
   bundle-time.

 ✘ [ERROR] Could not resolve "@jsonjoy.com/json-pack/lib/cbor/CborDecoderBase"

     node_modules/json-joy/lib/json-crdt/codec/structural/binary/Decoder.js:10:34:
       10 │ const CborDecoderBase_1 = require("@jsonjoy.com/json-pack/lib/cbor/CborDecoderBase");
          ╵                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   You can mark the path "@jsonjoy.com/json-pack/lib/cbor/CborDecoderBase" as external to exclude it
   from the bundle, which will remove this error and leave the unresolved path in the bundle. You can
   also surround this "require" call with a try/catch block to handle this failure at run-time
   instead of bundle-time.

 ✘ [ERROR] Could not resolve "@jsonjoy.com/json-pack/lib/cbor/CborEncoder"

     node_modules/json-joy/lib/json-crdt-patch/codec/binary/Encoder.js:8:30:
       8 │ const CborEncoder_1 = require("@jsonjoy.com/json-pack/lib/cbor/CborEncoder");
         ╵                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   You can mark the path "@jsonjoy.com/json-pack/lib/cbor/CborEncoder" as external to exclude it from
   the bundle, which will remove this error and leave the unresolved path in the bundle. You can also
   surround this "require" call with a try/catch block to handle this failure at run-time instead of
   bundle-time.

 ✘ [ERROR] Could not resolve "@jsonjoy.com/util/lib/buffers/Reader"

     node_modules/json-joy/lib/json-crdt-patch/util/binary/CrdtReader.js:4:25:
       4 │ const Reader_1 = require("@jsonjoy.com/util/lib/buffers/Reader");
         ╵                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   You can mark the path "@jsonjoy.com/util/lib/buffers/Reader" as external to exclude it from the
   bundle, which will remove this error and leave the unresolved path in the bundle. You can also
   surround this "require" call with a try/catch block to handle this failure at run-time instead of
   bundle-time.

 ✘ [ERROR] Could not resolve "@jsonjoy.com/util/lib/hasOwnProperty"

     node_modules/json-joy/lib/json-pointer/find.js:5:33:
       5 │ const hasOwnProperty_1 = require("@jsonjoy.com/util/lib/hasOwnProperty");
         ╵                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   You can mark the path "@jsonjoy.com/util/lib/hasOwnProperty" as external to exclude it from the
   bundle, which will remove this error and leave the unresolved path in the bundle. You can also
   surround this "require" call with a try/catch block to handle this failure at run-time instead of
   bundle-time.

 ✘ [ERROR] Could not resolve "@jsonjoy.com/util/lib/hasOwnProperty"

     node_modules/json-joy/lib/json-pointer/get.js:4:33:
       4 │ const hasOwnProperty_1 = require("@jsonjoy.com/util/lib/hasOwnProperty");
         ╵                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   You can mark the path "@jsonjoy.com/util/lib/hasOwnProperty" as external to exclude it from the
   bundle, which will remove this error and leave the unresolved path in the bundle. You can also
   surround this "require" call with a try/catch block to handle this failure at run-time instead of
   bundle-time.

 ✘ [ERROR] Could not resolve "@jsonjoy.com/util/lib/buffers/printOctets"

     node_modules/json-joy/lib/json-crdt/nodes/rga/AbstractRga.js:12:30:
       12 │ const printOctets_1 = require("@jsonjoy.com/util/lib/buffers/printOctets");
          ╵                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   You can mark the path "@jsonjoy.com/util/lib/buffers/printOctets" as external to exclude it from
   the bundle, which will remove this error and leave the unresolved path in the bundle. You can also
   surround this "require" call with a try/catch block to handle this failure at run-time instead of
   bundle-time.

 ✘ [ERROR] Could not resolve "@jsonjoy.com/util/lib/hasOwnProperty"

     node_modules/json-joy/lib/json-pointer/findByPointer/v5.js:5:33:
       5 │ const hasOwnProperty_1 = require("@jsonjoy.com/util/lib/hasOwnProperty");
         ╵                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   You can mark the path "@jsonjoy.com/util/lib/hasOwnProperty" as external to exclude it from the
   bundle, which will remove this error and leave the unresolved path in the bundle. You can also
   surround this "require" call with a try/catch block to handle this failure at run-time instead of
   bundle-time.

@macmillen
Copy link
Author

I solved it by installing these peer dependencies:

@jsonjoy.com/base64
@jsonjoy.com/json-pack
@jsonjoy.com/util

This should be noted in the Getting started guide.

@streamich
Copy link
Owner

Yes, indeed. A number of dependencies have been moved to "peer dependencies" to ensure they are the same version across libraries.

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

No branches or pull requests

2 participants