logdna / logdna/logdna-browser

The plugin ConsolePlugin is already registered with LogDNA Browser

Open
#59 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
23
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Framework:
- React with webpack

Created a brand new LogDNA key in the portal and am using that in the UI to connect to LogDNA.

Implementation:
`typescript
const [legger] = useState(
logdna.init((process.env.config as unknown as Config).logDnaApiKey, {
hostname: 'al-ui-2',
app: 'al-ui-3',
console: true,
})
);`

package json dependencies

![image](https://user-images.githubusercontent.com/62255879/202047939-30a40882-3aff-4cdf-8015-9efa47749668.png)

Webpack common

`javascript
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
entry: path.resolve(__dirname, '..', './src/index.tsx'),
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
module: {
rules: [
{
test: /\.(ts|js)x?$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
},
],
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(?:ico|gif|png|jpg|jpeg)$/i,
type: 'asset/resource',
},
{
test: /\.(woff(2)?|eot|ttf|otf|svg|)$/,
type: 'asset/inline',
},
],
},
output: {
path: path.resolve(__dirname, '..', './build'),
filename: 'bundle.js',
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, '..', './src/index.html'),
}),
],
stats: 'errors-only',
};
`

env specific Webpack:
![image](https://user-images.githubusercontent.com/62255879/202048133-36d8a7e0-3928-4d0d-8658-c6d2270acf21.png)

Error in UI(Firefox):
![image](https://user-images.githubusercontent.com/62255879/202048217-8b06230d-c9cc-43cd-8721-c494d0707f0c.png)

Firefox Console:
![image](https://user-images.githubusercontent.com/62255879/202049184-9437f37f-5a92-4a4b-a988-be6a186f1d4a.png)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Firefox error from the logdna.init call in src/index.tsx using the shown React and webpack setup. Read the common and environment-specific webpack configuration and compare the browser console output; done means the application initializes without the duplicate ConsolePlugin registration error.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript, webpack
Domain
frontend, observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.