feathersjs-ecosystem / feathers-debugger

Feathers Debugger Chrome extension
23 stars 0 forks source link

Can't expose endpoint feathers-debugger #2

Open matiaslopezd opened 3 years ago

matiaslopezd commented 3 years ago

Hi, excellent debugger!!

I'm trying to use it but can't :sob:, when try refresh directly from extension feathers debugger returns the error:

error: Page not found {"type":"FeathersError","name":"NotFound","code":404,"className":"not-found","data":{"url":"/feathers-debugger?$sort[ts]=1&$limit=500&ts[$gt]=1597784909432&$version=1.2.0"},"errors":{}}

I added to app.js

if (process.env.NODE_ENV === 'debug') app.configure(debuggerService());

And in app.hooks.js

const { trace } = require('feathers-debugger-service');

module.exports = {
  before: {
    all: [trace(), ...]
  },
  after: {
    all: [..., trace()]
  }
}

What I'm doing wrong? I have a custom socket file that is to say I'm not using channels.js, that can affect?

radenkovic commented 3 years ago

Hey, @matiaslopezd I am not sure what it is the problem, but I need to mention in docs that it relies on REST. So if REST is not exposed then it won't work

app.configure(express.rest());

Do you have this line in app.js? Also, try changing the order of app.configure(), put it at the very end but before those lines:

app.use(express.notFound());
app.use(express.errorHandler({ logger }));

Please keep me posted! I can add websocket support in next version!

matiaslopezd commented 3 years ago

Hi @radenkovic ! I'm tried again but nothing. :(

radenkovic commented 3 years ago

@matiaslopezd I am pushing new version soon!

Can you check process.env.NODE_ENV === 'debug', just

console.log(process.env.NODE_ENV)

in app.js.

matiaslopezd commented 3 years ago

Now it's working! But I don't know it's a bug or not but when receiving a new request is showed in extension but after ~5s disappear all. The same happens when observer mode is deactivated and you refresh manually all disappear.

Also sometimes the observer mode is not working and needs refresh manually.

2020-09-03 11-48-50

I'm using Google Chrome 85.0.4183.83 on Ubuntu 20.04.

@radenkovic Awesome tool!! :rocket:

radenkovic commented 3 years ago

@matiaslopezd I will take a look! to me it def looks like bug (like timeframe is very short), but will check what's going on. Anyways, glad to see that it's working!

extension but after ~5s disappear all

Do you have nodemon maybe? If server is restarted it cleans up the stored data.