--- /dev/null
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+use lib qw(t/lib);
+eval {
+ package DBICErrorTest::Schema;
+
+ use base 'DBIx::Class::Schema';
+ __PACKAGE__->load_classes('SourceWithError');
+};
+
+# Make sure the errors in components of resultset classes are reported right.
+like($@, qr!syntax error at t/lib/DBICErrorTest/SyntaxError.pm!);
--- /dev/null
+package DBICErrorTest::ResultSet::WithError;
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::ResultSet';
+
+__PACKAGE__->load_components('+DBICErrorTest::SyntaxError');
+
+1;
--- /dev/null
+package DBICErrorTest::Schema::SourceWithError;
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+__PACKAGE__->load_components('Core');
+__PACKAGE__->table('foo');
+#__PACKAGE__->load_components('+DBICErrorTest::SyntaxError');
+require DBICErrorTest::ResultSet::WithError;
+__PACKAGE__->resultset_class('DBICErrorTest::ResultSet::WithError');
+
+1;
--- /dev/null
+package DBICErrorTest::SyntaxError;
+
+use strict;
+
+I'm a syntax error!