You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use @storyblok/richtext in my NodeJS/Express application. Previously I was using storybloj-js-client/richtext but it is now deprecated. However, when running my compiled Node application with the node command, I am getting the following error:
require() of ES Module @storyblok/richtext/dist/storyblok-richtext.umd.js from @vsf-enterprise/storyblok-api/server/index.js
not supported. storyblok-richtext.umd.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains \"type\": \"module\" which declares all .js files in that package scope as ES modules.
Expected Behavior
Library works in a Node.js application which uses CommonJS
Current Behavior
Judging by the presence of the exports.require field in your library's package.json, I assume your intention was to support both browser and Node environments. However, to make it work in our Node application, I had to make the following changes to your library's package.json and symlink it in my project:
I can see there has already been a similar issue raised but it was closed immediately by the author. That makes me wonder if there is any other solution to the problem and reason behind using umd.js in the exports.require.
Steps to Reproduce
Please, let me know if you need those - I can prepare a sample Node app which reproduces the behaviour.
The text was updated successfully, but these errors were encountered:
lsliwaradioluz
changed the title
Usage in a Node.js application
Usage in a Node application
Jan 9, 2025
lsliwaradioluz
changed the title
Usage in a Node application
Usage in a Node/Expressapplication
Jan 9, 2025
I am trying to use
@storyblok/richtext
in my NodeJS/Express application. Previously I was usingstorybloj-js-client/richtext
but it is now deprecated. However, when running my compiled Node application with thenode
command, I am getting the following error:Expected Behavior
Library works in a Node.js application which uses CommonJS
Current Behavior
Judging by the presence of the
exports.require
field in your library'spackage.json
, I assume your intention was to support both browser and Node environments. However, to make it work in our Node application, I had to make the following changes to your library's package.json and symlink it in my project:I can see there has already been a similar issue raised but it was closed immediately by the author. That makes me wonder if there is any other solution to the problem and reason behind using
umd.js
in theexports.require
.Steps to Reproduce
Please, let me know if you need those - I can prepare a sample Node app which reproduces the behaviour.
The text was updated successfully, but these errors were encountered: