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

trying to upgrade to version 2 #363

Closed
3 tasks done
christophe-g opened this issue May 28, 2020 · 4 comments
Closed
3 tasks done

trying to upgrade to version 2 #363

christophe-g opened this issue May 28, 2020 · 4 comments

Comments

@christophe-g
Copy link
Contributor

Great to see snowpack evolving!

I am trying to upgrade one of my dependency (https://github.com/preignition/multi-chart) from version 1.7.1 to version 2.0.2

  • pnpm add -D snowpack@latest [note: I use pnpm and npm or yarn - was working well with version 1.7.1]
  • rename dedupe to installOptions.rollup.dedupe
  • rename webDependencies to install

> pnpx snowpack install

(node:14940) ExperimentalWarning: The dns.promises API is experimental
(node:14940) ExperimentalWarning: The fs.promises API is experimental
ignoring unsupported file "coverage/lcov.info"
ignoring unsupported file "multi-chart.sublime-project"
ignoring unsupported file "multi-chart.sublime-workspace"

Error: Parse error @:92:1
    at Object.parse (/home/christophe/Programming/Polymer/litElement/multi-chart/node_modules/.pnpm/registry.npmjs.org/es-module-lexer/0.3.20/node_modules/es-module-lexer/dist/lexer.cjs:1:407)
    at getInstallTargetsForFile (/home/christophe/Programming/Polymer/litElement/multi-chart/node_modules/.pnpm/registry.npmjs.org/snowpack/2.0.2/node_modules/snowpack/dist-node/index.js:1195:35)
    at loadedFiles.filter.map.code (/home/christophe/Programming/Polymer/litElement/multi-chart/node_modules/.pnpm/registry.npmjs.org/snowpack/2.0.2/node_modules/snowpack/dist-node/index.js:1298:57)
    at Array.map (<anonymous>)
    at scanImports (/home/christophe/Programming/Polymer/litElement/multi-chart/node_modules/.pnpm/registry.npmjs.org/snowpack/2.0.2/node_modules/snowpack/dist-node/index.js:1298:45)
@christophe-g christophe-g changed the title trying to upgrade to 2 trying to upgrade to version 2 May 28, 2020
@christophe-g
Copy link
Contributor Author

Solved by excluding some folders (in my case some .js files not properly formatted in a documentation folder).

It would be nice to have a more explicit error message, for instance which file is creating the parse error.

Migration remark
It took me some time to realize that version 2 scans the entire folder structure and fails to install to web_modules for this reason. For example, I had some unsolved dependencies (rollup-plugins) deep in a bower_components folder (yes, I am still using Polymer 2.0).

Running pnpx snowpack install against this repo was failing and complaining that rollup-plugin-node-polyfills or rollup-plugin-babel were not installed.

Thanks a lot for this new version anyway !

@FredKSchott
Copy link
Owner

That's a great call out, sounds like some action items to fix this are:

  • be more explicit about what files are being scanned
  • not fail completely on Parse error, just log that the file couldn't be scanned

@FredKSchott
Copy link
Owner

Thanks for taking the time to report. Spun off #369 to tackle, moving this discussion to our message boards

@pika-ci
Copy link

pika-ci bot commented May 28, 2020

🚚 This issue has been moved!
Continue the discussion on our project message board:
https://www.pika.dev/npm/snowpack/discuss/249What is this?

@pika-ci pika-ci bot closed this as completed May 28, 2020
@pika-ci pika-ci bot locked and limited conversation to collaborators May 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants