question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

query data is lost only in production mode

See original GitHub issue

hi, first thanks for your work 😃

i have a angular application integrated with your package, it has the following configuration in root module: SocketIoModule.forRoot({ url: environment.socket.url, options: { query: { userId: (<any>window).MaxDuel.instance.userId } } })

it works like charm only in development mode 😄 as soon as i ng build my app --prod the user id becomes null production development

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
orange1337commented, Apr 8, 2019

Found only one working solution for me:

// app.module.ts
...
const config: SocketIoConfig = { url: '/', options: { autoConnect: false } };
...
// myCustomService.ts
...
import * as io from 'socket.io-client';
import { Socket } from 'ngx-socket-io';
...
@Injectable()
export class MyCustomService {
   constructor(private socket: Socket) {}
   ...
   socketConnect(){
       this.socket.ioSocket.io.opts = {
           query: { account: (<any>window).localStorage.getItem('account') },
           path: '/socket.io/',
           autoConnect: true,
           reconnection: true,
           reconnectionDelay: 1000,
           reconnectionDelayMax : 5000,
           reconnectionAttempts: 10,
           transports: ['polling', 'websocket']
       };
       this.socket.ioSocket.io.uri = (<any>window).location.origin;
       this.socket.connect();
   }
   ...
}
// app.component.ts
 ...
   ngOnInit() {
      this.myCustomService.socketConnect();
  }
...
0reactions
ctfranciacommented, Apr 28, 2020

If this issue is still relevant please open up a new one since it is 2 years old

Read more comments on GitHub >

github_iconTop Results From Across the Web

Development Mode and Production Mode | Looker
Project files are read-only in this mode. Use Production Mode when you are exploring data in Looker for your own analyses or to...
Read more >
SQL query performance tuning tips for non-production ...
In this blog post you are going to see some tips for SQL query performance tuning in non-production environments and its configuration.
Read more >
Troubleshoot a query that shows different performance ...
Provides troubleshooting steps for an issue where a query shows significantly different performance on two servers.
Read more >
How to Recover Data (Without a Backup!) - Oracle Blogs
Do this in production and key parts of the business may come to a stop! ... Oracle only ensures you can query as...
Read more >
Best practices for Cloud Firestore - Firebase
If the lookup and the query do not have a data dependency, ... Using an offset only avoids returning the skipped documents to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found