Fork me on GitHub
#shadow-cljs
<
2021-01-24
>
Neros09:01:03

I am trying to get a QR code scanner to work in my project, I have tried several different ways but I am still getting problems. The most basic QR code example in react I have found is the following: I am trying to get a QR code scanner to work in my project, I have tried several different ways but I am still getting problems. The most basic QR code example in react I have found is the following:

import React from 'react';
import BarcodeScannerComponent from "react-webcam-barcode-scanner";

function App() {

  const [ data, setData ] = React.useState('Not Found');

  return (
    <>
      <BarcodeScannerComponent
        width={500}
        height={500}
        onUpdate={(err, result) => {
          if (result) setData(result.text)
          else setData('Not Found')
        }}
      />
      <p>{data}</p>
    </>
  )
}

export default App;
Any suggestions would be most grateful, thanks.

thheller10:01:19

and what CLJS did you try?

Neros10:01:34

shadow-cljs

thheller10:01:13

no the code

thheller10:01:52

> I have tried several different ways

Mr. Savy23:01:06

are there any tutorials anywhere online for building and deploying a shadow app as a jar? I tried just compiling it to js but I can't figure out how to get that working on a server. @neo2551 that article you linked was interesting but I couldn't figure out how to get it working with my use case.

lsenjov03:01:25

You mean constantly running it as a server? Or running it on a server to output compiled js?

Mr. Savy04:01:33

i'm not sure i understand the question, but I think the second one? I'm just trying to figure out how to run my release code on a server basically, and I think i'm going to need to use depstar to do it maybe.

aratare04:01:18

So I assume you have a java server for the backend and shadow-cljs for the frontend?

aratare04:01:48

in that case you can just uberjar both of them and have the server serve the frontend

Mr. Savy05:01:38

server is heroku, I think they have java buildscripts. i've been having trouble getting an uberjar set up correctly when i have tried!

aratare05:01:56

I'd recommend trying to build it manually first before setting up heroku. Wrestling with building an uberjar and heroku at the same time sounds like a bad time.

aratare05:01:37

at least doing so would help you pinpoint where you're having trouble with bundling an uberjar

Mr. Savy00:01:00

you're absolutely right! that's what i've been trying to do, unfortunately without much success. although, having thought about it some, I think building it isn't the issue. I can run the build after a release, but it crashes when i try to move it over to the server. so i think I need to get it onto the server in a form it recognizes, I'm going to try node and see if that gives any headway.