Skip to content
Back

[SWIFT] -> Error: type 'Bundle' has no member 'module'

  • 1
  • Self Hosted
  • Functions
  • Apple
Rajat
11 Dec, 2023, 07:18

Getting this error when I try to access my bundled resource files from my main function The screenshots attached shows my file structure by adding the resources folder containing html file + in Package.swift file I declared that folder also.

TL;DR
The user encountered an error in Swift when trying to access bundled resource files. They followed the approach of bundling their HTML file but received the error "type 'Bundle' has no member 'module'". They tried to find documentation on how to bundle files in Swift but couldn't find any specific to the Appwrite platform. They also wondered if bundles are exclusive to iOS. They provided screenshots of their file structure and Package.swift file. Solution: It's unclear from the given information how to solve the error. It may be necessary to review the code and consult Swift documentation or seek help from the Swift community.
Rajat
11 Dec, 2023, 08:46

[SWIFT] -> Error: type 'Bundle' has no member 'module'

Drake
11 Dec, 2023, 14:15

Hmmm are bundles an iOS thing only? 🧐

Rajat
11 Dec, 2023, 14:16

Umm…so I was looking at the documentation provided by Apple to add resources to your Swift package. -> https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package

Rajat
11 Dec, 2023, 14:17

I followed this approach to bundle my html file, is there any appwrite docs about bundling files in Swift package?

Rajat
11 Dec, 2023, 14:19

While ofc at the end I’m taking the String form for the html and returning it so technically I can save this file as a String variable and it would work fine….but I do want to maintain the practices followed by the specific function I’m trying to implement in Swift (by taking an idea from the already implemented nodeJS function in the templates repository)

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more