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

New project generation may create invalid Package.swift #279

Closed
selalipop opened this issue Nov 10, 2019 · 1 comment
Closed

New project generation may create invalid Package.swift #279

selalipop opened this issue Nov 10, 2019 · 1 comment

Comments

@selalipop
Copy link

selalipop commented Nov 10, 2019

Unfortunately I'm not sure about the input I entered during the wizard to cause this (The "Use fluent" question was answered yes), but my generated project failed to build:

error: manifest parse error(s):
Invalid semantic version string '-alpha'

caused by this line in Package.swift:

.package(url: "https://github.com/vapor/fluent--driver.git", from: "-alpha")

Replacing that with a valid repo and version fixes it

It looks like the selection I entered for my database was invalid, and so toolbox generated a line without the DB driver and version

@rpstro02
Copy link

rpstro02 commented Jan 3, 2020

A workaround for others having this issue. Replace the following lines in the generated Package.swift:

.package(url: "https://github.com/vapor/fluent--driver.git", from: "-beta")
...
.target(name: "App", dependencies: [ ... "FluentDriver", ... ]),

with the appropriate driver. For Postgres:

.package(url: "https://github.com/vapor/fluent-postgres-driver.git", from: "2.0.0-beta")
...
.target(name: "App", dependencies: [ ... "FluentPostgresDriver", ... ]),

You'll also have to change the import statement at the top of configure.swift to import the correct fluent driver:

import FluentPostgresDriver

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

3 participants