Imported a pwa project from github not working

I join Glitch yesterdat and want to try and so I mported a working project https://github.com/Minishlink/pwa-qr-code-scanner

this is the link

I add the start script on package. json to Gulpfile. js. install all dependencies.

But not working. What I miss?

1 Like

Hi @Bujangga_Hertog, welcome to the forum!

Did you change your project name? I can’t get on it. I’d like to remix to have a look.

What do the logs say in Glitch? (Click Tools, then Logs, near the bottom of the editor screen)

Hello. You need to add start script inside package.json files. By example:

{
  "scripts": {
    "start": "node ."
  }
}

However you may need to add build script as well.

I did… but still

I archived the project because I did too much thing to it… I try a new one importing the same source from Git hub but now taking too much time to import… I try different source also stalling as nothing happen. Why like this?

Ok, no worries.

I cloned the project from the GitHub repo, then added this in the package.json:

  "scripts": {
    "start": "gulp"
  }

It now starts up:

If your Glitch account is new (less than 2 days old) there is a limit on how many new projects you can create. This might be the reason for your new problems.

See if you can unarchive and restore the first project to its original state?

1 Like

thanks for the reply, I did reactivated the project
but the camera scanner dont run. on my android device…

could you please check…
it supposed to open camera like in below original link, may be you didn’t notice if you use laptop

QR Code Scanner

Really appreciated it

Basically it’s not working because the lib stuff doesn’t exist inside the assets directory. This is because yarn + bower install haven’t run successfully. I’m looking into that…

Another load of thoughts:

The way the original site works, is that running gulp build-dist will build the site for production into the dist folder. Then the dist folder can be hosted as a static site on GitHub Pages or wherever.

The way it’s currently running on Glitch is like a full-stack interactive app, so its just constantly rebuilding the dev environment. We need some way to build dist and then host that as a static site.

Fortunately, Glitch recently got “Generated Static Sites” to do this, so we should probably set up some config for that.

Better to make package.json like this:

  "scripts": {
    "start": "gulp prod"
  },
 "glitch": {
    "projectType": "generated_static"
  }
1 Like

That is the thing that I tried to create nodemodule directory by opening terminal and install bower and gulp using npm install command, but to my surprise glitch wont create the library. And then I tried also to install using yarn command also… the commands was running but not generating the files.

I dont know nothing yet about Glitch I thougt it has all function as a nodejs server as on my laptop BUT not local, it is online also. Look likes nothing like that or is it?

Yeah, it does, just sometimes when you’re importing a weird project you have to do some extra stuff to make it work. This project you’re importing uses tools from 5 years ago :sweat_smile:

In this case, it’s because Glitch doesn’t let yarn have all the permissions it needs. Glitch is designed to use pnpm (or npm).

So, I got it working. Here’s what you need to do after importing from GitHub:

Add bower to devDependencies:

  "devDependencies": {
    "bower": "^1.8.12",
    ...

Wait a few seconds, then go into the Glitch console and run:

bower i

Wait for that to complete, then run

refresh

If you have your site open in another tab, open devtools and clear down any Cache Storage it’s using. Then force-refresh the site with Ctrl+F5

This worked for me, and you see/remix the project at https://glitch.com/edit/#!/sg-qr-scanner

Hope it helps!

1 Like

Wow… I cick yours and it does work…amazing… now le me try mine… thank you its really a big help… I dont know much yet about coding but want to learn but before I spent time learning I want to make sure which tools that is work… and so thats the reason I just use code example from github or others …

Before I tried NGROK… not to much success though…until my old laptop fell off the floor while I fell asleep on it (old man does that lol…) and now totally dead. but I keep searching with my cell phone and came across glitch which is great because si far I only acess glitch only with my cellular device.

I know have confident to continue… but the details of find way around the problems still haunted me because no way find by just google it until I ask…so thank you for the quick response…

I see. I think you will have more luck starting with a remix from an existing Glitch project, they’re much more likely to work than importing any given GitHub project.

Check out the create-project options: https://glitch.com/create-project

…and the community contributions at the bottom of that page, too.

Have fun!

thanks @SteGriff , will do…