dharness / react-chat-window

Intercom-style live chat window written in react
The Unlicense
671 stars 250 forks source link

Build version #112

Closed unsafeFunction closed 5 years ago

unsafeFunction commented 5 years ago

Hi! I have an error, when run yarn start:production

ERROR: `react-chat-window/lib/assets/sounds/notification.mp3:1
(function (exports, require, module, __filename, __dirname) { ID3
                                                                 ^

SyntaxError: Invalid or unexpected token
    at new Script (vm.js:85:7)
    at createScript (vm.js:266:10)
    at Object.runInThisContext (vm.js:314:10)
    at Module._compile (internal/modules/cjs/loader.js:698:28)
    at Module._extensions..js (internal/modules/cjs/loader.js:749:10)
    at Object.newLoader [as .js] (/Users/alexei.mairyn/opensense-admin/node_modules/pirates/lib/index.js:88:7)
    at Module.load (internal/modules/cjs/loader.js:630:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
    at Function.Module._load (internal/modules/cjs/loader.js:562:3)
    at Module.require (internal/modules/cjs/loader.js:667:17)`
heatherbooker commented 5 years ago

Hi @unsafeFunction , I added some syntax highlighting to your question to help reading. :)

Are you trying to use or trying to contribute to react-chat-window? If you are trying to use it, can you explain a bit more your setup? Did you start a project, yarn add react-chat-window, and try to use it somewhere? What does your usage look like (import { Launcher } from 'react-chat-window' or something else)?

Also, I'm curious if the issue title "Build version" showed up somehow in the problem you're experiencing?

Thanks!

unsafeFunction commented 5 years ago

Hi @heatherbooker =) Yes, i add and import { Launcher } After that i run yarn start:production Production is a following command:
start:production": "NODE_ENV=production NODE_PATH=./src BABEL_ENV=production node build/server.js

And your question about issue title - yes, i mean, that when i build - it crash =(

heatherbooker commented 5 years ago

Are you using the Launcher in your code after you import it? How? If you could share your code here, that might be helpful to debug.

unsafeFunction commented 5 years ago

<Launcher agentProfile={{ teamName: 'Chat' }} onMessageWasSent={this.onMessageSent} messageList={messages} onFilesSelected={false} isOpen={isOpen} newMessagesCount={parseInt(count, 10) || 0} handleClick={this.handleClick} /> It's look like this. I think problem in audio notification and also, as i see site with demo not working in build version.

heatherbooker commented 5 years ago

I'm afraid I'm not sure what the problem is. :(

onFilesSelected should be a function, not a boolean, but that shouldn't stop the app from building. If all the other arguments that you are passing to the Launcher are of the correct type, it looks correct to me.

Some debugging ideas you could try and see if the app builds, then work from there:

Or if you can provide here a broader view of your whole project and setup (ie, every part of code that the rcw touches - where it's imported, required, used; where all variables passed as props to it are declared and/or modified; etc) here, maybe we can help more that way. (As a link to a project on github, or if you want to paste code I suggest using 3 backticks(`) on a new line, so that it appears in a block :) )

dharness commented 5 years ago

This has been inactive for a while so I'm going to close it. Feel free to re-open if the problem develops.