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

Building using Rollup failed #1

Open
andre-rafa-b opened this issue Jul 29, 2019 · 1 comment
Open

Building using Rollup failed #1

andre-rafa-b opened this issue Jul 29, 2019 · 1 comment

Comments

@andre-rafa-b
Copy link

Hi,

first congrats for the job. It is a really nice react component. Although, I couldn't build my project using rollup.

Results bellow:
(!) thishas been rewritten toundefined https://rollupjs.org/guide/en/#error-this-is-undefined node_modules\@matharumanpreet00\react-daterange-picker\build\index.js 1: "use strict"; 2: var __assign = (this && this.__assign) || function () { ^ 3: __assign = Object.assign || function(t) { 4: for (var s, i = 1, n = arguments.length; i < n; i++) { ...and 5 other occurrences [!] Error: 'DateRangePicker' is not exported by node_modules\@matharumanpreet00\react-daterange-picker\build\index.js https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module- src\Dashboards\Compras\index.jsx (2:9) 1: import React, { Component } from 'react'; 2: import { DateRangePicker, DateRange } from "@matharumanpreet00/react-daterange-picker"; ^ 3: 4: import ContratacoesPorPeriodo from 'ContratacoesPorPeriodo'; Error: 'DateRangePicker' is not exported by node_modules\@matharumanpreet00\react-daterange-picker\build\index.js

package.json:
"scripts": { "test": "echo \"Error: no test specified\" && exit 1", "dev": "rollup -c src/rollup.config.js --compact" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "@babel/core": "^7.5.5", "@babel/preset-env": "^7.5.5", "@babel/preset-react": "^7.0.0", "rollup": "^1.17.0", "rollup-plugin-babel": "^4.3.3", "rollup-plugin-node-resolve": "^5.2.0" }, "dependencies": { "@material-ui/core": "^4.3.0", "@matharumanpreet00/react-daterange-picker": "^1.0.5" }

@flippingbitss
Copy link
Owner

@andre-rafa-b Thanks. I haven't used rollup before, it looks like a module resolution problem, do you have config setup properly ? Maybe try this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants