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

Module not found: Can't resolve 'rdf-canonize-native' during build in RDFLib dependency #665

Open
danielbakas opened this issue Mar 6, 2025 · 3 comments

Comments

@danielbakas
Copy link

danielbakas commented Mar 6, 2025

Hi!

While building a Next.js project that includes RDFLib ([email protected]), the build fails due to a missing module error in rdf-canonize:

Module not found: Can't resolve 'rdf-canonize-native' in '.../node_modules/.pnpm/[email protected]/node_modules/rdf-canonize/lib'

This error seems to originate from rdf-canonize, which is a dependency of jsonld, which in turn is required by RDFLib.

Steps to Reproduce

  1. Create a Next.js project ([email protected]).
  2. Install [email protected] using pnpm.
  3. Run next build.

Expected Behavior

The build should complete successfully without missing dependencies.

Actual Behavior

  • The build fails with Module not found: Can't resolve 'rdf-canonize-native'.
  • The issue appears in the dependency chain: rdflib → jsonld → rdf-canonize.
  • A separate TypeError: Cannot set properties of undefined (setting 'WordArray') also appears in the logs.

Environment

  • Package Manager: pnpm
  • RDFLib Version: 2.2.37
  • Next.js Version: 15.2.1
  • Node.js Version: 23.9.0

Attempts to solve

  • Add rdf-canonize-native dependency → Failed (different error) at installation

Full Log

next dev

   ▲ Next.js 15.2.1
   - Local:        http://localhost:3000
   - Network:      http://192.168.68.105:3000

 ✓ Starting...
 ✓ Ready in 2.7s
 ○ Compiling / ...
 ⚠ ./node_modules/.pnpm/[email protected]/node_modules/rdf-canonize/lib/index.js
Module not found: Can't resolve 'rdf-canonize-native' in '.../node_modules/.pnpm/[email protected]/node_modules/rdf-canonize/lib'

Import trace for requested module:
./node_modules/.pnpm/[email protected]/node_modules/rdf-canonize/lib/index.js
./node_modules/.pnpm/[email protected]/node_modules/rdf-canonize/index.js
./node_modules/.pnpm/[email protected][email protected]/node_modules/jsonld/lib/jsonld.js
./node_modules/.pnpm/[email protected][email protected]/node_modules/jsonld/lib/index.js
./node_modules/.pnpm/[email protected][email protected]/node_modules/rdflib/esm/jsonldparser.js
./node_modules/.pnpm/[email protected][email protected]/node_modules/rdflib/esm/fetcher.js
./node_modules/.pnpm/[email protected][email protected]/node_modules/rdflib/esm/index.js

Conclusion

Thank you in advance!!!

@danielbakas
Copy link
Author

Related to digitalbazaar/rdf-canonize-native#10

@davidlehn
Copy link

digitalbazaar/jsonld.js#567 (comment)

@bourgeoa
Copy link
Member

bourgeoa commented Mar 8, 2025

Can I do anything to help resolve this issue. Is it a new version issue ?

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

3 participants