@xmtp/react-sdk throws the follwing error in the console when executing "yarn dev" and the application gets stuck there:
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/Users/doktordos/Developer/ensvision/node_modules/date-fns/min' is not supported resolving ES modules imported from /Users/doktordos/Developer/ensvision/node_modules/@xmtp/react-sdk/lib/index.js
Did you mean to import date-fns/min/index.js?
I tried changing the imports in node_modules/@xmtp/react-sdk as follows:
/node_modules/@xmtp/react-sdk/lib/index.js
Lines 10-11:
import Gt from 'date-fns/min';
import $t from 'date-fns/subSeconds';
to:
import { min as Gt} from 'date-fns';
import { subSeconds as $t} from 'date-fns';
Describe the bug
@xmtp/react-sdk throws the follwing error in the console when executing "yarn dev" and the application gets stuck there:
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/Users/doktordos/Developer/ensvision/node_modules/date-fns/min' is not supported resolving ES modules imported from /Users/doktordos/Developer/ensvision/node_modules/@xmtp/react-sdk/lib/index.js Did you mean to import date-fns/min/index.js?
I tried changing the imports in node_modules/@xmtp/react-sdk as follows: /node_modules/@xmtp/react-sdk/lib/index.js
Lines 10-11:
import Gt from 'date-fns/min'; import $t from 'date-fns/subSeconds';
to:
import { min as Gt} from 'date-fns'; import { subSeconds as $t} from 'date-fns';
and afterwards all works as expected.
Could you please change the following imports so the package will work out of the box on next.js: https://github.com/xmtp/xmtp-web/commit/0b215a6813e9896f7c69e4d0193948478411b568
Expected behavior
See above.
Steps to reproduce the bug
Installed package @xmtp/react-sdk in next.js project via yarn add @xmtp/react-sdk throws above mentioned error in console.