angular2-meteor feature module import error: Uncaught TypeError: Cannot read property 'replace' of undefined extractStyleUrls - angular-meteor

created angular2 feature module when import module to main app.module, getting below error
modules.js?hash=83df0dc…:35050 Uncaught TypeError: Cannot read property 'replace' of undefinedextractStyleUrls # modules.js?hash=83df0dc…:35050(anonymous function) # modules.js?hash=83df0dc…:38274DirectiveNormalizer.normalizeStylesheet # modules.js?hash=83df0dc…:38273DirectiveNormalizer.normalizeLoadedTemplate # modules.js?hash=83df0dc…:38203DirectiveNormalizer.normalizeTemplateSync # modules.js?hash=83df0dc…:38178DirectiveNormalizer.normalizeTemplate # modules.js?hash=83df0dc…:38155CompileMetadataResolver._loadDirectiveMetadata # modules.js?hash=83df0dc…:42474(anonymous function) # modules.js?hash=83df0dc…:42650CompileMetadataResolver.loadNgModuleDirectiveAndPipeMetadata # modules.js?hash=83df0dc…:42649(anonymous function) # modules.js?hash=83df0dc…:51875JitCompiler._loadModules # modules.js?hash=83df0dc…:51874JitCompiler._compileModuleAndComponents # modules.js?hash=83df0dc…:51829JitCompiler.compileModuleAsync # modules.js?hash=83df0dc…:51795PlatformRef_._bootstrapModuleWithZone # modules.js?hash=83df0dc…:61199PlatformRef_.bootstrapModule # modules.js?hash=83df0dc…:61174(anonymous function) # main.ts:10maybeReady # meteor.js?hash=e3f53db…:809loadingCompleted # meteor.js?hash=e3f53db…:821
I'm new to angular 2 and meteor,please help me.

Related

Poise cookbook failing with compilation error

I am getting compile error on poise cookbook . i started to get this error starting yesterday. was there any change done recently ? or do we have fix for this ??
=============================================================================== Recipe Compile Error in
/Users/admin/bootstrap/chef/conf/local-mode-cache/cache/cookbooks/poise-archive/libraries/default.rb
ArgumentError
------------- wrong number of arguments (given 2, expected 1)
Cookbook Trace: (most recent call first)
---------------------------------------- /Users/admin/bootstrap/chef/conf/local-mode-cache/cache/cookbooks/poise/files/halite_gem/poise/helpers/option_collector.rb:98:in
option_collector_attribute' /Users/admin/bootstrap/chef/conf/local-mode-cache/cache/cookbooks/poise/files/halite_gem/poise/helpers/option_collector.rb:83:in attribute'
/Users/admin/bootstrap/chef/conf/local-mode-cache/cache/cookbooks/poise/files/halite_gem/poise/helpers/template_content.rb:143:in
attribute' /Users/admin/bootstrap/chef/conf/local-mode-cache/cache/cookbooks/poise-archive/files/halite_gem/poise_archive/resources/poise_archive.rb:67:in class:Resource'
/Users/admin/bootstrap/chef/conf/local-mode-cache/cache/cookbooks/poise-archive/files/halite_gem/poise_archive/resources/poise_archive.rb:39:in
<module:PoiseArchive>' /Users/admin/bootstrap/chef/conf/local-mode-cache/cache/cookbooks/poise-archive/files/halite_gem/poise_archive/resources/poise_archive.rb:28:in module:Resources'
/Users/admin/bootstrap/chef/conf/local-mode-cache/cache/cookbooks/poise-archive/files/halite_gem/poise_archive/resources/poise_archive.rb:25:in
<module:PoiseArchive>' /Users/admin/bootstrap/chef/conf/local-mode-cache/cache/cookbooks/poise-archive/files/halite_gem/poise_archive/resources/poise_archive.rb:24:in <top (required)>'
/Users/admin/bootstrap/chef/conf/local-mode-cache/cache/cookbooks/poise-archive/files/halite_gem/poise_archive/resources.rb:17:in
<top (required)>' /Users/admin/bootstrap/chef/conf/local-mode-cache/cache/cookbooks/poise-archive/files/halite_gem/poise_archive/cheftie.rb:17:in <top (required)>'
/Users/admin/bootstrap/chef/conf/local-mode-cache/cache/cookbooks/poise-archive/libraries/default.rb:19:in
`<top (required)>'
Relevant File Content:
---------------------- /Users/admin/bootstrap/chef/conf/local-mode-cache/cache/cookbooks/poise/files/halite_gem/poise/helpers/option_collector.rb:
91: # #param name [String, Symbol] Name of the attribute to
define. 92: # #param default [Hash] Default value for the
options. 93: # #param parser [Proc, Symbol] Optional parser
method. If a symbol it is 94: # called as a method on
self. Takes a non-hash value and returns a 95: # hash of
its parsed representation. 96: # #param forced_keys
[Array, Set] Method names that will be forced 97:
to be options rather than calls to the parent resource. 98>> def option_collector_attribute(name, default: {}, parser: nil,
forced_keys: Set.new) 99: raise Poise::Error.new("Parser
must be a Proc or Symbol: #{parser.inspect}") if parser &&
!(parser.is_a?(Proc) || parser.is_a?(Symbol)) 100: # Cast
to a set at definition time. 101: forced_keys =
Set.new(forced_keys) unless forced_keys.is_a?(Set) 102: #
Never allow name to be called accidentally since it does really wonky
things. 103: forced_keys.add(:name) 104: #
Unlike LWRPBase.attribute, I don't care about Ruby 1.8. Worlds tiniest
violin. 105: define_method(name.to_sym) do |arg=nil,
&block| 106: iv_sym = :"##{name}" 107:
System Info:
------------ chef_version=17.0.242 platform=mac_os_x platform_version=10.15.4 ruby=ruby 3.0.1p64 (2021-04-05 revision
0fb782ee38) [x86_64-darwin18] program_name=/usr/local/bin//chef-client
executable=/opt/chef/bin/chef-client
The poise-archive cookbook has been deprecated and archived for a long time:
https://github.com/poise/poise-archive
On Chef Infra 17.0 those poise_archive resources should be converted to archive_file resources which do not require an external cookbook:
https://docs.chef.io/resources/archive_file
The poise cookbooks being broken is not a bug which will be fixed.

undefined method `entry_mapping' for nil:NilClass

I am trying to play around with the RODA Ruby web framework based on Rack. However, I am having issues with using Minitest with the framework. RSpec was hectic with it too unlike Rails. I tried to reproduce the error with pry, but I couldn't make sense of it. How should I fix this? I am getting
undefined method `entry_mapping' for nil:NilClass.
Below is the associated code:
Gemfile
gem 'contentful_model', '~> 1.3' # ActiveModel-like wrapper for the Contentful SDKs
group :test do
gem 'capybara'
gem 'minitest', '>= 5.7.0'
gem 'minitest-hooks', '>= 1.1.0'
gem "minitest-global_expectations"
gem "warning"
gem 'pry'
end
models/recipe.rb
require 'contentful_model'
class Recipe < ContentfulModel::Base
self.content_type_id = 'recipe'
def self.all_recipes
all.load!
end
end
app.rb | Tree Routing
require './.env' if File.exist?(".env.rb")
require './config/initializers/contentful_model'
require 'roda'
require './models/recipe'
require 'tilt/sass'
class App < Roda
hash_routes do
view '', 'index'
end
route do |r|
#recipes = Recipe.all_recipes
r.public
r.assets
check_csrf!
r.hash_routes('')
r.get String do |id|
#recipe_details = Recipe.find(id)
next unless #recipe_details
view 'show'
end
end
end
spec/models/spec_helper.rb
ENV["RACK_ENV"] = "test"
require_relative '../../models/recipe'
require_relative '../minitest_helper'
spec/models/recipe_spec.rb
require_relative 'spec_helper'
describe Recipe do
let(:recipes) { Recipe.all_recipes }
describe '.all_recipes' do
it 'return all records with content type recipe' do
recipes = Recipe.all_recipes # undefined method `entry_mapping' for nil:NilClass
expect(recipes).to all must_be Recipe
end
end
end
pry debug
From: /Users/tiwa/RubymineProjects/marley-spoon-roda/spec/models/recipe_spec.rb:27 .all_recipes#test_0001_return all records with content type recipe:
24: it 'return all records with content type recipe' do
25: recipes = Recipe.all_recipes # undefined method `entry_mapping' for nil:NilClass
26: binding.pry
=> 27: expect(recipes).to all must_be Recipe
28: end
[1] pry(#<.all_recipes>)> Recipe.all_recipes
NoMethodError: undefined method `entry_mapping' for nil:NilClass
from /Users/tiwa/.gem/ruby/2.7.1/gems/contentful_model-1.3.0/lib/contentful_model/base.rb:124:in `mapping?'
I see the code in contentful_model-1.3.0/lib/contentful_model/base.rb:124 is:
ContentfulModel.configuration.entry_mapping.key?(#content_type_id)
If error msg is undefined method `entry_mapping' for nil:NilClass then
ContentfulModel.configuration
Is nil
To fix this you need configure ContentfulModel. Something like that:
ContentfulModel.configure do |config|
config.access_token = "your access token in here" # Required
config.preview_access_token = "your preview token in here" # Optional - required if you want to use the preview API
config.management_token = "your management token in here" # Optional - required if you want to update or create content
config.space = "your space id in here" # Required
config.environment = "master" # Optional - defaults to 'master'
config.default_locale = "en-US" # Optional - defaults to 'en-US'
config.options = { # Optional
# Extra options to send to the Contentful::Client and Contentful::Management::Client
# See https://github.com/contentful/contentful.rb#configuration
# Optional:
# Use `delivery_api` and `management_api` keys to limit to what API the settings
# will apply. Useful because Delivery API is usually visitor facing, while Management
# is used in background tasks that can run much longer. For example:
delivery_api: {
timeout_read: 6
},
management_api: {
timeout_read: 100
}
}
end
With this config this call is not more nil
ContentfulModel.configuration
See https://github.com/contentful/contentful_model

undefined method `lane' for main:Object

I have 2 files:
Fastfile
group.rb
Fastfile
# frozen_string_literal: true
fastlane_version '2.116.0'
default_platform :ios
import "fastfiles/group.rb"
platform :ios do
lane :pr_build do
set_enterprise_app_id
end
end
group.rb
lane :set_enterprise_app_id do
update_app_ids(
app_id: BUNDLE_ID_ENTERPRISE,
shared_extension_id: BUNDLE_ID_ENTERPRISE_SHAREEXTENSION
)
update_app_group(APP_GROUP_ENTERPRISE)
end
But get error on my CI:
[!] undefined method `lane' for main:Object
I tried next in group.rb
platform :iOS do
lane :set_enterprise_app_id do
update_app_ids(
app_id: BUNDLE_ID_ENTERPRISE,
shared_extension_id: BUNDLE_ID_ENTERPRISE_SHAREEXTENSION
)
update_app_group(APP_GROUP_ENTERPRISE)
end
end
But get next error:
[!] undefined method `platform' for main:Object

Ruby - Error: undefined method `[]' for nil:NilClass

So, I'm new to Ruby and I'm trying to install this photo gallery to my Jekyll blog. However, when I'm trying to run
jekyll build
I get this error message:
Liquid Exception: undefined method `[]' for nil:NilClass in photography/index.html
jekyll 3.7.2 | Error: undefined method `[]' for nil:NilClass
With --trace it points me to:
/Users/hal9000/Desktop/Plommonstop/_plugins/jekyll-exiftag-mod.rb:18:in `render': undefined method `[]' for nil:NilClass (NoMethodError)
But now I don't understand how to proceed. jekyll-exiftag-mod looks like this:
require 'exifr/jpeg'
#Based on https://github.com/benib/jekyll-exiftag by Beni Buess (MIT License)
#Edited to work as a Liquid-Block instead of a Liquid-Tag, reads the filename from between the
#brackets. --T.Winter
module Jekyll
class ExifTag < Liquid::Block
def initialize(tag_name, params, token)
super
#args = self.split_params(params)
end
def render(context)
#abort context.registers[:site].config['source'].inspect
sources = Array.new(context.registers[:site].config['exiftag']['sources'])
# first param is the exif tag
tag = #args[0]
# if a second parameter is passed, use it as a possible img source
if #args.count > 1
sources.unshift(#args[1])
end
# the image can be passed as the third parameter
img = super
# first check if the given img is already the path
if File.exist?(img)
file_name = img
else
# then start testing with the sources from _config.yml
begin
source = sources.shift
file_name = File.join(context.registers[:site].config['source'], source, img)
end until File.exist?(file_name) or sources.count == 0
end
# try it and return empty string on failure
begin
exif = EXIFR::JPEG::new(file_name)
return tag.split('.').inject(exif){|o,m| o.send(m)}
rescue
"ERROR, EXIF-Tag RB"
end
end
def split_params(params)
params.split(",").map(&:strip)
end
end
end
Liquid::Template.register_tag('exiftag', Jekyll::ExifTag)
With row 18:
sources = Array.new(context.registers[:site].config['exiftag']['sources'])
What does it mean with "Undefined method `[]' for nil:NilClass?" And what exactly is making this problem occur?
The error could simply mean that you have not set ['exiftag']['sources'] in your config file.
Your config file should have something similar to below (entry1 and entry2 are just examples):
exiftag:
sources:
- entry1
- entry2
Do note, indentation is important in YAML as well..

Why doesn't "Time#since" not work for me?

Why this is not working for me:
class Time
# Return the time difference (as a Float) between now and a specified older Time or parse-able String.
# a = Time.now
# Time.since(a) # => 8.920116
# a.since(a) # => 0.0
# Time.since '11:30' # => 28.111561
# Time.since '9am' # => 9138.288258
def self.since(older_time)
Time.now.since(older_time)
end
def since(older_time)
self - (older_time.kind_of?(Time) ? older_time : Time.parse(older_time))
end
end
puts Time.since '9am'
Error message:
.rb:13:in since': undefined method
parse' for Time:Class (NoMethodError)
from TimeSince.rb:9:in since' from
TimeSince.rb:17:in'
You're not doing require 'time' before it, and so the Time.parse method (and every other method in the Time class) will be unavailable.

Resources