GithubHelp home page GithubHelp logo

Comments (5)

CanadaHonk avatar CanadaHonk commented on August 10, 2024

Could you please send the Gluon code you're using?

from gluon.

boblund avatar boblund commented on August 10, 2024

Hi,

It's the gluworld index.js loading a different index.html

import * as Gluon from '@gluon-framework/gluon';

(async () => {
  const browsers = process.argv.slice(2).filter(x => !x.startsWith('-'));

  if (browsers.length > 0) { // use argv as browsers to use
    for (const forceBrowser of browsers) {
      await Gluon.open('../owntonePled/index.html', {
        windowSize: [ 800, 500 ],
        forceBrowser
      });
    }

    return;
  }

  await Gluon.open('../../owntonePled/index.html', {
    windowSize: [ 800, 500 ]
  });
})();

Here's the code that makes the HTTP request

function curl(cmd, method='GET', headers={}, body='') {
	return new Promise((resolve, reject) => {
		const http = new XMLHttpRequest();
		http.open(method, `${href}${cmd}`);
		http.send();
		http.onreadystatechange = function() {
			if(this.readyState === 4) {
				if(this.status === 200) {
					resolve(http.responseText);
				} else {
					reject(new Error('Failed to load page, status code: ' + this.status));
				}
			}
		};
	});
};

from gluon.

boblund avatar boblund commented on August 10, 2024

I tried the gluworld code with this:

await Gluon.open('http://localhost:3000', {
  allowHTTP: true,
  windowSize: [ 800, 500 ]
});

and my app works as expected. So, it seems the HTTP limitation is in the gluon backend that hosts my web app?

I also tried :

Gluon.open('../owntonePled/index.html', {
        windowSize: [ 800, 500 ],
        forceBrowser
}

and got
image

After clicking reload I get this console message:

file:///Users/blund/Documents/SW%20Development/gluon/examples/gluworld/node_modules/@gluon-framework/gluon/src/launcher/inject.js:64
        let oldUrl = history.entries[history.currentIndex - 1].url;
                                                               ^

TypeError: Cannot read properties of undefined (reading 'url') at file:///Users/blund/Documents/SW%20Development/gluon/examples/gluworld/node_modules/@gluon-framework/gluon/src/launcher/inject.js:64:64
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

from gluon.

CanadaHonk avatar CanadaHonk commented on August 10, 2024

Is any of your code using a .local URL? Also ensure that path in your code ../ is relative to your JS file, and that you're using the latest Gluon version.

from gluon.

CanadaHonk avatar CanadaHonk commented on August 10, 2024

Closing due to inactivity (and Discord should be used for support instead).

from gluon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.