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

Unable to run example #2

Closed
adrianlzt opened this issue Mar 21, 2024 · 2 comments · Fixed by #3
Closed

Unable to run example #2

adrianlzt opened this issue Mar 21, 2024 · 2 comments · Fixed by #3
Assignees

Comments

@adrianlzt
Copy link

I was trying to add this module to a react app and having problems (Module not found: Error: Can't resolve 'react-audio-stream' in), so I decided to try the basic example and build from that, but the example is neither working:

➜ npm instal
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility

added 203 packages, and audited 204 packages in 21s

87 packages are looking for funding
  run `npm fund` for details


react-audio-stream/example at arco on  master [?] is 📦 v0.1.0 via ⬢ v18.17.0 at ☸️ 
➜ npm start

> example@0.1.0 start
> parcel ./src/index.html

Server running at http://localhost:1234
🚨 Build failed.

@parcel/core: Failed to resolve 'react-audio-stream' from './src/App.tsx'

  /var/tmp/tmp.Kd0CajPIKm/react-audio-stream/example/src/App.tsx:2:32
    1 | import React from 'react'
  > 2 | import { useAudioStream } from 'react-audio-stream'
  >   |                                ^^^^^^^^^^^^^^^^^^^^
    3 |
    4 | const App = () => {

@parcel/resolver-default: Could not load './dist/esm/index.js' from module 'react-audio-stream' found in package.json#module

  /var/tmp/tmp.Kd0CajPIKm/react-audio-stream/example/node_modules/react-audio-stream/package.json:6:13
    5 |   "main": "./dist/cjs/index.js",
  > 6 |   "module": "./dist/esm/index.js",
  >   |             ^^^^^^^^^^^^^^^^^^^^^ './dist/esm/index.js' does not exist, did you mean './dist/esm/hooks/index.js'?'
    7 |   "types": "./dist/esm/index.d.ts",
    8 |   "scripts": {

Maybe its something basic, I'm not experienced at react/js.

Thanks!

@adrianlzt
Copy link
Author

Workaround making the change suggested

  > 6 |   "module": "./dist/esm/index.js",
  >   |             ^^^^^^^^^^^^^^^^^^^^^ './dist/esm/index.js' does not exist, did you mean './dist/esm/hooks/index.js'?'

@balaji-sivasakthi
Copy link
Owner

Hi @adrianlzt,

Thanks for finding this issue and providing a workaround! Your help was greatly appreciated.

@balaji-sivasakthi balaji-sivasakthi self-assigned this Mar 24, 2024
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

Successfully merging a pull request may close this issue.

2 participants