Error after update Package.swift -->Add Leaf.git

Hello ,

I’m learning vapor swift til Chapter14 Templating with Leaf.
I have followed by the tutorial.
It can build and run the vapor project without any problem on my local pc .

Anyway, when I upload to the server and update Package.swift ,then build the project using below command on linux ubuntu server. It error like below.
I check the current swift version on the server.
It’s swift version 4.1 (swift-4.1-RELEASE).
I’m very appreciated if you could advise.

$Swift Package update

$ vapor build
Building Project [Failed]

/root/practice/Sources/App/Models/Acronym.swift:51:17: error: value of type ‘SchemaCreator’ has no member ‘addReference’
try builder.addReference(from: .userID, to: \

Here is the update Package.swift of the project on the server

// swift-tools-version:4.1
import PackageDescription

let package = Package(
name: “TILApp6”,
dependencies: [
.package(url: “”, from: “3.0.0-rc”),
.package(url: “”, from: “3.0.0-rc”),
.package(url: “”, from: “3.0.0-rc”)
targets: [
.target(name: “App”, dependencies: [“FluentMySQL”, “Vapor”,“Leaf”]),
.target(name: “Run”, dependencies: [“App”]),
.testTarget(name: “AppTests”, dependencies: [“App”]),

Best Regards,

The syntax has changed (I’m not sure if the deprecations were removed in Fluent 3.0) :thinking:

However, the new syntax is

Thanks for the advice.
It solved the problem. ^^

1 Like