WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Client side routing, navigation and routing would work.

Current Behavior

Ran next export and when I serve locally (and online) there's a client side JavaScript error that breaks all the client side logic.

Without sourcemaps (or any other debugging tools?) I can't work out what's happening. Live URL: https://dkfyjniin9u60.cloudfront.net/ (see console in browser).

Not sure I can replicate as yet, as it's larger site - pretty sure the vanilla examples work.

Context

Including the next.config.js - possibly this is factoring?

const { env } = process;
const webpack = require('webpack');

module.exports = {
exportPathMap () {
// we fetch our list of posts, this allow us to dynamically generate the exported pages
const all = require('./server/lib/docs');

// transform the list of posts into a map of pages with the pathname `/post/:id`
const pages = all.posts.docs.reduce((pages, post) =>
Object.assign({}, pages, {
[`${post.url}`]: {
page: '/_post',
query: { slug: post.slug }
}
}),
{});

// combine the map of post pages with the home
return Object.assign({}, pages, {
'/': { page: '/' }
});
},

webpack: function (config) {
// this exposes everything on process.env.X
const webpackEnv = Object.keys(env).reduce((acc, curr) => {
acc[`process.env.${curr}`] = JSON.stringify(env[curr]);
return acc;
}, {});

config.plugins.push(new webpack.DefinePlugin(webpackEnv));

return config;
}
};

Your Environment

Tech
Version

next
3.0.1-beta.13

node
8.1.0

OS
Mac 10.10.3 (14D136)

browser
Chrome Version 61.0.3156.0 (Official Build) canary (64-bit)

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

When I'm deploying a production build, I should have minified javascript code in order to minimize file size and maximize performance.

Current Behavior

My app.js is 529KB and not minified

Steps to Reproduce (for bugs)

next build

next start

OR

next build

next export

Context

I wanted to use next.js in order to have a lightning fast site as advertised but no minification kills that. I'm sure I'm missing something simple.

Your Environment

Tech
Version

next
4.1.1

node
8.4.0

OS
MacOS Sierra 10.12.6

browser
Chrome

etc
React and react-dom 16
Issue 1:
babel --version
6.1.1 (babel-core 6.0.20)

.babelrc

{
'presets': ['es2015', 'stage-0', 'react']
}

EmptyComponent.jsx

class EmptyComponent extends React.Component {
constructor() {
super()
}

nextStep = (e) => {
e.preventDefault()
this.saveValues()
}
}

Running babel:

$ babel src/app/components/EmptyComponent.jsx
SyntaxError: src/app/components/EmptyComponent.jsx: 'this' is not allowed before super() (This is an error on an internal node. Probably an internal error)
undefined

However, this compiles successfully (just removed the this.saveValues() invocation)

class EmptyComponent extends React.Component {
constructor() {
super()
}

nextStep = (e) => {
e.preventDefault()
}
}

Issue 2:
Hello, I found that autobinding in classes are not work after update to 6.0

'this' is not allowed before super() (This is an error on an internal node. Probably an internal error)

.babelrc

{
"presets": [
"react",
"es2015",
"stage-0"
]
}

Is it expected behavior?

Thanks!
Issue 1:
#2376

I'm having this problem and none of the two suggested workarounds worked for me, and I don't know whether it's fixed or not.

Symfony2.3

Issue 2:
Errors are not associated with the field when the indices has a gap.

The errors are displayed for both fields.

<input type="text" id="post_photos_0_fileName" name="post[photos][0][fileName]" value="" />
<input type="text" id="post_photos_1_fileName" name="post[photos][1][fileName]" value="" />

Errors are only displayed for the first field.

<input type="text" id="post_photos_0_fileName" name="post[photos][0][fileName]" value="" />
<input type="text" id="post_photos_2_fileName" name="post[photos][2][fileName]" value="" />

public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add(
'photos',
'collection',
array(
'type' => new PhotoType(),
'allow_add' => true,
'allow_delete' => true,
'prototype' => true,
'by_reference' => false
)

);
}
Issue 1:
iterFunc({|| ret; }) does not return from the outer function.

Maybe we'll just have accept this, since in the absence of non-local control flow, there's no nice way to implement such returns.

Issue 2:
Sometimes when enabling debug info and optimizations at the same time, rustc dies with an assertion in the LLVM method ValueHandleBase::ValueIsDeleted():

While deleting: metadata %
An asserting value handle still pointed to this value!
UNREACHABLE executed at /home/sc/projects/rust/rust/src/llvm/lib/IR/Value.cpp:632!

This is one the major issues keeping debug info from being end-user ready (see #9770).

I was already able to identify the cause for the assertion:

The failure itself says that a value handle still points to the metadata node that is currently being deleted. This leaked handle is created in LLVM's DwarfDebug::collectDeadVariables() on a path that is only hit with optimizations activated. That's why the assertion is never triggered when compiling something without the -O flag.

The memory leak occurs because the method cannot handle duplicate entries in the list of subprograms in the compile unit. This is a bug in LLVM: http://llvm.org/bugs/show_bug.cgi?id=16017

It's not clear yet how it will be fixed exactly.

But the issue should also be tackled on our side: That LLVM reacts with a memory leak to invalid input is unfortunate but it's still us that generate the invalid input. The main issue here is that some functions are translated more than once (see issue #7349) and thus they are also added to the debug info function list more than once.

I think the best way to fix this issue is to fix #7349. This way we don't have to wait for LLVM to take care of their side. Also, the folks at LLVM might decide to just assert on invalid input, so we have take care of this anyway.
Issue 1:
This is a vague bug but here is my intention:

Look at common bugs (returning a closure, etc) and see if we can improve the error messages for those

Try to improve the heuristics that suggest how to report a region inference failure, which frequently give nonsense results

Issue 2:
@jimtla pasted his code he was working with on IRC and I simplified it a bit:

#[derive(Clone)]
struct A (B);

impl A {
pub fn matches<F: Fn()>(&self, f: &F) {
let &A(ref term) = self;
term.matches(f);
}
}

#[derive(Clone)]
enum B {
Variant1,
Variant2(C),
}

impl B {
pub fn matches<F: Fn()>(&self, f: &F) {
match self {
&B::Variant2(ref factor) => {
factor.matches(&|| ())
}
_ => unreachable!("")
}
}
}

#[derive(Clone)]
struct C (D);

impl C {
pub fn matches<F: Fn()>(&self, f: &F) {
let &C(ref base) = self;
base.matches(&|| {
C(base.clone()).matches(f)
})
}
}

#[derive(Clone)]
struct D (Box<A>);

impl D {
pub fn matches<F: Fn()>(&self, f: &F) {
let &D(ref a) = self;
a.matches(f)
}
}

pub fn matches() {
A(B::Variant1).matches(&(|| ()))
}

fn main() {}

/t/m/h/src (master|…) $ rustc lib.rs
lib.rs:18:36: 18:37 warning: unused variable: `f`, #[warn(unused_variables)] on by default
lib.rs:18 pub fn matches<F: Fn()>(&self, f: &F) {
^

thread 'rustc' has overflowed its stack
fish: Job 1, 'rustc lib.rs ' terminated by signal SIGILL (Illegal instruction)

This might be a duplicate of #21410
Issue 1:
Bug Report

Which version of ShardingSphere did you use?

4.1.1

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-proxy

Expected behavior

connection

my yaml

Issue 2:
Bug Report

Which version of ShardingSphere did you use?

Faced an issue upgrading from 3.1.0 to 4.0.1

Which project did you use? Sharding-JDBC or Sharding-Proxy?

sharding-jdbc-core

https://mvnrepository.com/artifact/org.apache.shardingsphere/sharding-jdbc-core/4.0.1

Expected behavior

Insert query needs to run as usual

Actual behavior

Getting java.sql.SQLException: No value specified for parameter 1

Reason analyze (If you can)

Please notice in the below log fragment, the insertValueContexts is empty. Also, in the logic and actual sql, all the columns mentioned in columnNames in SQLContext are not present. This is what is causing the error as per my understanding.

Logic SQL: insert into sample_table (client, create_date, source, key_string, ticket_id) values (?, ?, ?, ?, ?)

SQLStatement: InsertSQLStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement@3b8923ff, tablesContext=TablesContext(tables=[Table(name= sample_table, alias=Optional.absent())], schema=Optional.absent())), columnNames=[id, client, ticket_id, source, key_string, source_id, create_date, update_date], insertValueContexts=[])

Actual SQL: shard-1 ::: insert into sample_table (client, create_date, source, key_string, ticket_id) values (?, ?, ?, ?, ?)

Proposed fix

The above error gets fixed if I rename column source to something else. I tried option_source and it worked.

Can source column name be supported please
Issue 1:
by brharrington:

Not sure if this is the correct place to raise the issue or not. One annoyance I found
while looking at Go is that every page on golang.org has the same title. This is really
annoying for using the reference documentation with numerous tabs for different packages
open as it is hard to know which tab is for the package I want. It would be useful if
the titles reflected the content of the page.

Issue 2:
What does 'go version' print?
$ go version
go version go1.2 linux/amd64
Issue 1:
I haven't found a duplicate issue, only this post https://groups.google.com/forum/#!searchin/reactjs/render$20multiple/reactjs/pHNJe8trFOg/J-zd4jxAkJ4J

I have a valid use case and like to share it.

I'm building a framework for storytelling based on react. Every single element is positioned fixed as I've written a custom layout engine and need full control over everything. My entry level structure looks something like this

<Story>
<Grid />
<UI />
</Story>

<Grid> renders all the actual items (<GridItem>) of the story (text, images, videos, etc.). <UI /> renders UI elements that are common to every story. For example a <VolumeControl> for controling the volume of audio/video items.

If I'd render the structure as given above, this would be the result

<div>
<div>
<!--list of GridItems-->
</div>
<div>
<!--list of UI components-->
</div>
</div>

Since everything is positioned fixed, this does not work. The UI layer covers everything, making it unusable (e.g. can't click on videos). That's why I'm currently forced to do the following in the render method of Story

<div>
<Grid />
<VolumeControl />
<Navigation />
<ShareButtons />
</div>

This works but is ugly as I lose separation. I don't want the Story component to have to know about every UI component. Sth. like a virtual <Fragment> component that renders it's children without a wrapper element would solve the problem as I could return it from the <UI> component.

I know this is a rare use-case, I'm rather talented at reaching the edge cases of every framework I touch.

Funny how writing down these things sometimes magically makes your brain do useful stuff. I found another workaround. I'm using visiblity:none on the UI layer and visibility:visible on the UI components. But it's a hack, nothing more.

Issue 2:
Note from maintainers:

We know this is an issue and we know exactly what set of problem can be solved. We want this too but it is a hard problem with our current architecture. Additional comments expressing desire for this feature are not helpful. Feel free to subscribe to the issue (there's button in the right hand column) but do not comment unless you are adding value to the discussion. "Me too" and "+1" are not valuable, nor are use cases that have already been written in the comments (e.g., we know that you can't put <tr> or <dd> elements with a <div>).

Consider the following:

var ManagePost = React.createClass({

render: function() {
var posts = this.props.posts

var something;
var somethingelse;

var row = posts.map(function(post){
return(
<div>
<div className="col-md-8">
</div>
<div className="cold-md-4">
</div>
</div>
)
});

return (
{row}
);
}

});

If you remove the <div></div> in the map, you get the following error: Adjacent XJS elements must be wrapped in an enclosing tag

it isn't till I re-add the surrounding, and rather pointless, divs that it compiles with out issue. I am running 0.11.1

Is this being addressed? It adds extra, and again - IMO - useless and pointless html to the page, that while harming nothing - looks messy and unprofessional. Maybe I am just doing something wrong, please enlighten me if I am.
Issue 1:
#5602 switched to static Visual C++ runtime, but there are issues with that:

The runtime is unnecessarily duplicated in node.dll and electron.exe.

#7281 reports that Electron-wide native exception handling is broken because exception handlers are applied per runtime instance.

node.dll exports some symbols of the runtime, and when a native node module uses the dynamic runtime, it can mistakenly bind to those symbols instead of the ones from msvcp140 and friends. This ends up causing crashes when an object is initialized using one instance of the runtime and destroyed using the other instance.

Wrapper functions had to be introduced to make even Electron itself run correctly with the statically linked runtime.

The reason why it was decided to link the runtime statically was to "remove" a dependency on the Universal CRT (UCRT). That argument is weak, because the dependency is not actually removed, but merely UCRT is also statically linked and duplicated. Therefore the real argument is to not have to redistribute the UCRT binaries for non-updated Windows 7 systems and that is not a strong enough reason to justify the above problems.

So I am suggesting we move back to linking the VC runtime dynamically and redistribute it together with UCRT. I will prepare and submit a PR in the coming days.

Issue 2:
for some reason, the will-navigate event handler does not fire from the renderer process, i have only tested for the will-navigate event listener, am not sure if this is the behaviour of other webContents event listeners

Expected behavior

the webContents will-navigate event handler should fire and prevent the window from navigating

Actual behavior

the webContents will-navigate event does not fire, instead the window navigates

How to reproduce

main.js

const { BrowserWindow, app } = require("electron");

app.on("ready", () => {
let win = new BrowserWindow({});

win.on("close", () => {
win = null;
app.quit();
});

win.webContents.openDevTools({
mode: "detached"
});
win.loadURL(`file://${__dirname}/index.html`);
});

index.html

<!doctype html>

<html>
<head>
<title> Webcontents from renderer proces </title>
</head>
<body>
<p> Drag and Drop Something Here</p>

<script>
const { remote: { getCurrentWindow } } = require("electron");
const webContents = getCurrentWindow().webContents;
console.log(webContents);
webContents.on("will-navigate", (evt,filePath) => {
evt.preventDefault();
console.log(filePath);
});
</script>
</body>
</html>

Electron version: 1.7.11

Operating system: Gnu/Linux
Issue 1:
As reported in https://blog.discordapp.com/lessons-from-migrating-a-large-codebase-to-react-16-e60e49102aa6, it could've been clearer.

Issue 2:
Do you want to request a feature or report a bug? bug

What is the current behavior?

The following piece of code breaks the rules of hooks:

import {useState} from 'react';
const MyComponent = () => {
const [foo, setFoo] = useState ();
if ( !foo ) return;
const [bar, setBar] = useState ();
return null;
};

The lint rule reports:

React Hook "useState" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return?

What is the expected behavior?

My understanding is that for hooks to work they need to be called always in the same order, otherwise returned values can't be properly mapped to function calls.

In my piece of code the hooks are always called in the same order, but some times we exit early, which is slightly beneficial both for performance and for writing clean code.

Shouldn't this just work?

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? v16.8.6
Issue 1:
bower install does not get ./grunt folder.

in Gruntfile.js

these

var generateGlyphiconsData = require('./docs/grunt/bs-glyphicons-data-generator.js');

var BsLessdocParser = require('./docs/grunt/bs-lessdoc-parser.js');

var generateRawFilesJs = require('./docs/grunt/bs-raw-files-generator.js');

should be

var generateGlyphiconsData = require('./grunt/bs-glyphicons-data-generator.js');

var BsLessdocParser = require('./grunt/bs-lessdoc-parser.js');

var generateRawFilesJs = require('./grunt/bs-raw-files-generator.js');

Issue 2:
Apologies if this has already been reported, I looked but didn't see anything about this issue specifically (unless it's related in some way to the comments in #12504?)..

The bower.json line 18 excludes the docs folder, while Gruntfile.js lines 20-22 try to load files from the (now missing) docs folder and the build fails.

I'm busy cloning the main repo into another folder to copy over the missing files, but surely if these are required to build the .less files, then they should be moved to a folder that isn't excluded?

Edit: Just to confirm, after copying the docs/ folder into my project's bower_components/bootstrap/ folder, the grunt build worked perfectly.
Issue 1:
I tried using the @types/react package and had problems.

I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript

I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).

Mention the authors (see Definitions by: in index.d.ts) so they can respond.

Authors: @johnnyreilly, @bbenezech, ...

With current typings it is not possible to create a stateless component which returns a string, number, boolean... (new in React 16)

import React from 'react'

const TestString = () => {
return 'Test String Component'
}

const Component = () => (
<div>
<TestString/>
</div>
)

Error I get:

JSX element type 'string' is not a constructor function for JSX elements.

The first problem is that currently in the typings a stateless component cannot return anything else besides an instance of a React.Element. This should be changed to (I think, I've based it upon the changes on the rendermethod, see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L422)

interface StatelessComponent<P = {}> {
(props: P & { children?: ReactNode }, context?: any): ReactElement<any> | Array<ReactElement<any>> | string | number | null;
propTypes?: ValidationMap<P>;
contextTypes?: ValidationMap<any>;
defaultProps?: Partial<P>;
displayName?: string;
}

Second problem is that behind the scenes the compiler will convert the jsx to `React.createElement('Test String Component', null)``

I get a compiler error that is saying that this is not a valid value. Seems that it has to be one of the values specified in following list: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L3465.

Any thoughts on how this can be fixed?

Issue 2:
I tried using the @types/xxxx package and had problems.

I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript

I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).

Mention the authors (see Definitions by: in index.d.ts) so they can respond.

Authors: @gaspard @vbfox

As mentioned in React documentation, a stateless component can return false for empty content. Currently StatelessComponent is defined as:

interface StatelessComponent<P = {}> {
(props: P & { children?: ReactNode }, context?: any): ReactElement<any> | null;

whereas Component has

class Component<P, S> {
constructor(props?: P, context?: any);
// ...snip...
render(): JSX.Element | null | false;

Shouldn't these types be the same (including eliminating the ReactElement vs JSX.Element difference)? And to avoid future such issues (#14064, this one) it should probably be a named type, e.g. RenderResult.

A search for | null also comes up with ComponentSpec.render which probably should also have the same result type.
Issue 1:
I am getting the following

ERROR in ./src/main.jsx
Module build failed: SyntaxError: /Users/sam/src/main.jsx: 'this' is not allowed before super() (This is an error on an internal node. Probably an internal error)
at File.buildCodeFrameError (/Users/sam/node_modules/@apple/reviz-dev/node_modules/babel-core/lib/transformation/file/index.js:408:15)
at NodePath.buildCodeFrameError (/Users/sam/node_modules/@apple/reviz-dev/node_modules/babel-core/node_modules/babel-traverse/lib/path/index.js:143:26)
at ThisExpression (/Users/sam/node_modules/babel-preset-es2015/node_modules/babel-plugin-transform-es2015-classes/lib/vanilla.js:73:20)

When I try to compile the following:

import React from 'react';
import ReactDOM from 'react-dom';

class Main extends React.Component {
constructor() {
super();
this.state = {};
}

myHandler = () => {
this.setState({newState: true});
};

render() {
return (
<div></div>
);
}
}

It is only failing when I include this inside the myHandler function. There have been several issues similar to this, I had hoped this would resolve when #2942 was closed, but I'm still seeing it in the latest 6.1.19.

My babel settings look like:

loader: 'babel-loader',
query: {
presets: ['es2015', 'stage-0', 'react']
}

Issue 2:
Input:

class MyClass extends ParentClass {
property = foo;
}

Error:

SyntaxError: index.js: 'super.*' is not allowed before super() (This is an error on an internal node. Probably an internal error)
undefined

Notes:

Doesn't happen with constructor() { super() }

Needs ParentClass to occur

Doesn't matter what the value of the class property is.

Example repo: https://github.com/thejameskyle/__babel-bug-2942