Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Megalodon object fails to instantiate in React builds #25

Open
alicerunsonfedora opened this issue Jan 31, 2019 · 0 comments
Open

Megalodon object fails to instantiate in React builds #25

alicerunsonfedora opened this issue Jan 31, 2019 · 0 comments
Labels

Comments

@alicerunsonfedora
Copy link

Originally noted from hyperspacedev/hyperspace-classic#1:

Note: this might be more related to Hyperspace itself than to all React apps.

Megalodon objects instantiate and function normally in a React app when running react-scripts start. However, when running react-scripts test or react-scripts build and then serving the built content, the instantiation fails.

In Hyperspace, the following error occurs:

TypeError: "n is undefined"
	t App.js:26
Ii16React	448 index.js:7
	f (index):1
	184 main.b0bd95cd.chunk.js:1
	f (index):1
	a (index):1
	e (index):1
	<anonymous> main.b0bd95cd.chunk.js:1
 react-dom.production.min.js:3869
ya16React	448 index.js:7
	f (index):1
	184 main.b0bd95cd.chunk.js:1
	f (index):1
	a (index):1
	e (index):1
	<anonymous> main.b0bd95cd.chunk.js:1

Steps to reproduce

  1. In the App component, create a constructor and field for the client:
class App extends Component {
    client;
    constructor(props) {
        super(props);
        this.client = new Mastodon(accesstoken, baseurl + '/api/v1');
    }
}
  1. Use that client for a task (say, passing it down to a ComposeWindow element):
<App>
    <ComposeWindow client={this.client}/>
</App>
@h3poteto h3poteto added the ToDo label Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants