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
Failed to generate server side code on windows 10 #58
Comments
Thanks for the report. Currently only Mac and Linux is supported, but Windows support will be coming later this spring. |
@vlidholt update on this? |
There has been work done in the latest version 0.9.6. I failed to test it in a virtual machine since it couldn't run a virtual machine inside a virtual machine. |
showing this when runs
|
showing this when runs
|
This is because the paths weren't handled correctly. Look at the path. It has both |
May be PR #130 will fix this. Fixed logs with verbose Connecting to VM Service at http://127.0.0.1:58631/UXY48y1g9HA=/
WARNING! Windows is not officially supported yet. Things may or may not work as expected.
Generating classes
Generating server side code.
- processing file: lib\src\protocol\example_class.yaml
Generating Dart client side code.
- processing file: lib\src\protocol\example_class.yaml
Generating protocol
Analyzing protocol
Generating client endpoints
/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */
/* To generate run: "serverpod generate" */
// ignore_for_file: public_member_api_docs
// ignore_for_file: unused_import
import 'dart:io';
import 'dart:typed_data' as typed_data;
import 'package:serverpod_client/serverpod_client.dart';
import 'protocol.dart';
class _EndpointExample extends EndpointRef {
@override
String get name => 'example';
_EndpointExample(EndpointCaller caller) : super(caller);
Future<String> hello(String name,) async {
return await caller.callServerEndpoint('example', 'hello', 'String', {
'name':name,
});
}
}
class Client extends ServerpodClient {
late final _EndpointExample example;
Client(String host, {SecurityContext? context, ServerpodClientErrorCallback? errorHandler, AuthenticationKeyManager? authenticationKeyManager}) : super(host, Protocol.instance, context: context, errorHandler: errorHandler, authenticationKeyManager: authenticationKeyManager) {
example = _EndpointExample(this);
}
@override
Map<String, EndpointRef> get endpointRefLookup => {
'example' : example,
};
@override
Map<String, ModuleEndpointCaller> get moduleLookup => {
};
}
Writing: ../dummy_client/lib/src/protocol\client.dart
Generating server endpoint dispatch
/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */
/* To generate run: "serverpod generate" */
// ignore_for_file: public_member_api_docs
// ignore_for_file: unnecessary_import
// ignore_for_file: unused_import
import 'dart:typed_data' as typed_data;
import 'package:serverpod/serverpod.dart';
import 'protocol.dart';
import '../endpoints/example_endpoint.dart';
class Endpoints extends EndpointDispatch {
@override
void initializeEndpoints(Server server) {
var endpoints = <String, Endpoint>{
'example': ExampleEndpoint()..initialize(server, 'example', null),
};
connectors['example'] = EndpointConnector(
name: 'example',
endpoint: endpoints['example']!,
methodConnectors: {
'hello': MethodConnector(
name: 'hello',
params: {
'name': ParameterDescription(name: 'name', type: String, nullable: false),
},
call: (Session session, Map<String, dynamic> params) async {
return (endpoints['example'] as ExampleEndpoint).hello(session,params['name'],);
},
),
},
);
}
@override
void registerModules(Serverpod pod) {
}
}
Writing: lib\src\generated\endpoints.dart
Writing: generated\protocol.yaml
Dart format
Formatted client.dart
Formatted example_class.dart
Formatted protocol.dart
Formatted 3 files (3 changed) in 0.30 seconds.
Formatted endpoints.dart
Formatted example_class.dart
Formatted protocol.dart
Formatted 3 files (3 changed) in 0.29 seconds.
Done.
Exited System configs: NOTE: |
Hope this goes under new issue. or check #121 |
Wrapped some lines with try-catch and found this minnu@Minnus-Mac dummy_server % /Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/serverpod_cli_minnu generate -v
Generating classes
Generating server side code.
- processing file: lib/src/protocol/example_class.yaml
Generating Dart client side code.
- processing file: lib/src/protocol/example_class.yaml
Generating protocol
Analyzing protocol
[exception: FileSystemException(path=/Users/minnu/Documents/Flutter/serverpod/tools/lib/_internal/sdk_library_metadata/lib/libraries.dart; message=Cannot open file)][stackTrace: #0 _PhysicalFile.readAsStringSync (package:analyzer/file_system/physical_file_system.dart:158)
#1 FolderBasedDartSdk.initialLibraryMap (package:analyzer/src/dart/sdk/sdk.dart:479)
#2 new FolderBasedDartSdk (package:analyzer/src/dart/sdk/sdk.dart:377)
#3 ContextBuilderImpl._createSdk (package:analyzer/src/dart/analysis/context_builder.dart:170)
#4 ContextBuilderImpl.createContext (package:analyzer/src/dart/analysis/context_builder.dart:87)
#5 new AnalysisContextCollectionImpl (package:analyzer/src/dart/analysis/analysis_context_collection.dart:67)
#6 new ProtocolAnalyzer (file:///Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/bin/generator/protocol_analyzer.dart:46)
#7 performAnalysis (file:///Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/bin/generator/protocol_analyzer.dart:31)
#8 performGenerateProtocol (file:///Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/bin/generator/protocol_generator.dart:16)
#9 performGenerate (file:///Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/bin/generator/generator.dart:13)
#10 main (file:///Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/bin/serverpod_cli.dart:224)
<asynchronous suspension>
]
[exception: FileSystemException(path=/Users/minnu/Documents/Flutter/serverpod/tools/lib/_internal/libraries.dart; message=Cannot open file)][stackTrace: #0 _PhysicalFile.readAsStringSync (package:analyzer/file_system/physical_file_system.dart:158)
#1 FolderBasedDartSdk.initialLibraryMap (package:analyzer/src/dart/sdk/sdk.dart:479)
#2 new FolderBasedDartSdk (package:analyzer/src/dart/sdk/sdk.dart:377)
#3 ContextBuilderImpl._createSdk (package:analyzer/src/dart/analysis/context_builder.dart:170)
#4 ContextBuilderImpl.createContext (package:analyzer/src/dart/analysis/context_builder.dart:87)
#5 new AnalysisContextCollectionImpl (package:analyzer/src/dart/analysis/analysis_context_collection.dart:67)
#6 new ProtocolAnalyzer (file:///Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/bin/generator/protocol_analyzer.dart:46)
#7 performAnalysis (file:///Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/bin/generator/protocol_analyzer.dart:31)
#8 performGenerateProtocol (file:///Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/bin/generator/protocol_generator.dart:16)
#9 performGenerate (file:///Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/bin/generator/generator.dart:13)
#10 main (file:///Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/bin/serverpod_cli.dart:224)
<asynchronous suspension>
]
Unhandled exception:
FileSystemException(path=/Users/minnu/Documents/Flutter/serverpod/tools/lib/_internal/allowed_experiments.json; message=Cannot open file)
#0 _PhysicalFile.readAsStringSync (package:analyzer/file_system/physical_file_system.dart:158)
#1 FolderBasedDartSdk.allowedExperimentsJson (package:analyzer/src/dart/sdk/sdk.dart:386)
#2 FeatureSetProvider._experimentsForSdk (package:analyzer/src/dart/analysis/feature_set_provider.dart:150)
#3 FeatureSetProvider.build (package:analyzer/src/dart/analysis/feature_set_provider.dart:137)
#4 AnalysisDriver._createFileTracker (package:analyzer/src/dart/analysis/driver.dart:1643)
#5 new AnalysisDriver (package:analyzer/src/dart/analysis/driver.dart:281)
#6 ContextBuilderImpl.createContext (package:analyzer/src/dart/analysis/context_builder.dart:106)
#7 new AnalysisContextCollectionImpl (package:analyzer/src/dart/analysis/analysis_context_collection.dart:67)
#8 new ProtocolAnalyzer (file:///Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/bin/generator/protocol_analyzer.dart:46)
#9 performAnalysis (file:///Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/bin/generator/protocol_analyzer.dart:31)
#10 performGenerateProtocol (file:///Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/bin/generator/protocol_generator.dart:16)
#11 performGenerate (file:///Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/bin/generator/generator.dart:13)
#12 main (file:///Users/minnu/Documents/Flutter/serverpod/tools/serverpod_cli/bin/serverpod_cli.dart:224)
<asynchronous suspension> The code works fine in debug mode, cause the required paths were there during the runtime but when it comes out of it, it doesn't. |
If I don't provide any path in I don't think Win 10 and win 11 will make a huge difference |
This is now working for me on the dev branch. Only tested on a fresh Windows 10 install. Closing for now. |
SERVERPOD version: 0.9.19 mode: development time: 2022-10-29 01:23:33.955686Z 2022-10-29 01:23:36.542741Z Internal server error. Failed to load method lookup. Insights listening on port 8081 Local stacktrace: |
@FaisalHDT Can you please provide the context? Like what are you doing, what you got and what you expected to get. |
in the protocol folder I created a class containing class: Article after that i run the command serverpod generate --watch |
@FaisalHDT Okie... So you are running server code and it doesn't work 🤔. Looks like |
still does'nt work |
@FaisalHDT I think I know the issue, but need to get clarified. If you could able DM me somewhere on social media, we can collaborate and solve this issue. |
did you check your DB? @derek-alves I mean all the tables are created? Do you see any |
I ran setup-tables and now run the server, thanks a lot! |
If you see one, Then there will be a file called |
i have same problem but i can resolve it. how |
Failed to connect to the database. Retrying in 10 seconds. PostgreSQLSeverity.error 42P01: relation "serverpod_runtime_settings" does not exist I have a problem, I can not solve it. please help |
Describe the bug:
Failed to generate server side code after running the command
Reproduce code:
Environment:
flutter doctor -v
The text was updated successfully, but these errors were encountered: