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.

Import issues with Grommet 1.3.0

See original GitHub issue

I’ve upgraded from Grommet 1.2.1 to 1.3.0 and found a couple of issues with my imports.

Here’s an example of how I include Grommet’s components using ES6 and Babel:

My custom app class:

import Grommet from 'grommet';

export class App extends React.Component {

	static propTypes = {
		children: React.PropTypes.element
	}

	constructor() {
		super();
	}

	render() {
		return (
			<Grommet.App centered={ false }>
				{ this.props.children }
			</Grommet.App>
		);
	}
}

After upgrading Node complained Cannot read property 'App' of undefined. I had to change my import statement to this:

import GrommetApp from 'grommet/components/App';

Similar is true for icons. I used to be able to do

import { Icons } from 'grommet';

//...
	render() {
		return <Icons.Base.Menu />;
	}
//...

This throws the similar error Cannot read property 'Base' of undefined.

I understand that it’s not necessarily optimal to import Grommet and Icons directly, but is this really an intentional change between 1.2.1 and 1.3.0?

Your Environment

  • Grommet version: 1.3.0
  • Node v4.4.7 with Babel and Webpack

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
alansouzaticommented, Mar 21, 2017

Humm 😢

I need to double check that, but you are probably right. Sorry it is being a while since I’ve touch the commonjs bundle and I apologize for the back and forth.

0reactions
araboldcommented, Mar 23, 2017

I’m happy to tell you that this works as expected now 👍

Thanks for taking care of all the issues. I will rework our code to use the Icon postfix in future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Importing issues from CSV - GitLab Docs
The user uploading the CSV file is set as the author of the imported issues. You must have at least the Developer role...
Read more >
CSV import issues. Receiving an error - WordPress.org
I exported my inventory file made updates and now when I try and import the file I get an error. “Sorry, this file...
Read more >
[Archivesspace_Users_Group] Importing Accessions with CSV ...
Re: Problems with ASpace reports (Karrie L Roberson) > 9. import error, ... (1.0ms) > > Rendered > /opt/archivesspace-1.3.0/archivesspace/ ...
Read more >
Import Products for Magento 2 - Amasty
Import Magento 2 products with images, reviews, categories and any other data you need. ... interfaces to complete the most sophisticated import challenges....
Read more >
Plugin: CSV Import - Mantis Bug Tracker - Forums
Thinking maybe the columns had changed, I exported an issue using the CSV Export and compared the column names. The names all matched...
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